/** * 新充电流程:验证插头模块 * @邠心vbe on 2023/06/20 */ import React, { useEffect, useState } from 'react'; import { View, Text, Image, StyleSheet } from 'react-native'; import app from '../../../app.json'; import Button from '../../components/Button'; import TextView from '../../components/TextView'; import { PaymentList } from '../chargeV2/Payment'; import PaymentListV2 from '../chargeV2/PaymentListV2'; export default StepAuth = ({ status="", currentPayment, onStartCharge, chargeBoxId, onPaymentMethodChanged }) => { 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')} {/* */} { app.v3.paymentMethod ? : } { isAuthentic ?