/** * 新充电流程:停止充电模块 * @邠心vbe on 2023/06/20 */ import React, { useEffect, useState } from 'react'; import { View, Text, Image, StyleSheet } from 'react-native'; import TextView from '../../components/TextView'; import StatusImage from './StatusImage'; import { PageList } from '../Router'; export default StepStop = ({ chargingPk="", stationInfo={} }) => { const [isStoping, setStoping] = useState(false); const [loadingEmps, setEmps] = useState(""); useEffect(() => { if (chargingPk) { setStoping(true); } else { changeEmps(); } }, [chargingPk]); useEffect(() => { if (!isStoping) { setTimeout(() => { changeEmps(); }, 500); } }, [loadingEmps]); const changeEmps = () => { let emp = loadingEmps; if (loadingEmps.length == 3) { emp = ""; } else { emp += "."; } setEmps(emp); } return ( {$t(isStoping ? 'charging.stepStoppedCharge' : 'charging.stepStoppingCharge')} { !isStoping && {loadingEmps} } {$t(isStoping ? 'charging.stepStoppedChargeDesc' : 'charging.stepStoppingChargeDesc')} { isStoping &&