/** * 支付组件 * @邠心vbe on 2021/04/23 */ import React, { useEffect, useState } from 'react'; import { View, Text, StyleSheet, Image, Pressable } from 'react-native'; import Button, { ElevationObject } from '../../components/Button'; import TextView from '../../components/TextView'; import utils from '../../utils/utils'; import { LowCreditDialog } from '../charge/InfoDialog'; import { PaymentDefault } from '../payment/PaymentConfig'; import { PageList } from '../Router'; const Payment = ({ topup, balance, payType = PaymentDefault.DEFAULT.payName, isWallet = PaymentDefault.DEFAULT.isWallet, isPayPerUse = PaymentDefault.DEFAULT.isPayPerUse, canShowLowCreditDialog = false, onMethodChange, refreshId = 0 }) => { const [visible, showDialog] = useState(false) useEffect(() => { if (balance == undefined && canShowLowCreditDialog) { if (userInfo.credit <= 5 && refreshId > 0) { showDialog(true) } } }, [refreshId]); return ( { isWallet || isPayPerUse ? {payType} : Visa/Mastercard Credit/Debit Card } {isWallet ? currency + (balance ?? userInfo.credit) : ''} { topup ?