/** * 新充电流程:验证插头模块 * @邠心vbe on 2023/06/20 */ import React, { useEffect, useState } from 'react'; import { View, Text, Image, StyleSheet } from 'react-native'; import Button from '../../components/Button'; import TextView from '../../components/TextView'; import { PaymentList } from '../chargeV2/Payment'; export default StepAuth = ({ status="", currentPayment, curerntPerUse, onStartCharge }) => { const [loadingEmps, setEmps] = useState(""); const [isAuthentic, setAuthentic] = useState(false) useEffect(() => { if (status == "Preparing") { setAuthentic(true); } else { changeEmps(); } }, []); useEffect(() => { if (status == "Preparing") { setAuthentic(true); } else { setTimeout(() => { changeEmps(); }, 500); } }, [loadingEmps, status]); const changeEmps = () => { let emp = loadingEmps; if (loadingEmps.length == 3) { emp = ""; } else { emp += "."; } setEmps(emp); } return ( { isAuthentic ? {$t('charging.stepAuthenticated')} : {$t('charging.stepAuthenticating')} {loadingEmps} } {$t(isAuthentic ? 'charging.stepAuthenticatedDesc' : 'charging.stepAuthenticatingDesc')} {$t('charging.paymentMethod')} { isAuthentic ?