/** * 钱包卡片组件 * @邠心vbe on 2025/01/17 */ import React from 'react'; import { Pressable, StyleSheet } from 'react-native'; import { View } from 'react-native'; import { ElevationObject } from '../../components/Button'; import TextView from '../../components/TextView'; import utils from '../../utils/utils'; import { toTopupPage } from '../payment/PaymentConfig'; const ViewWallet = ({ wallet, setDefault }) => ( {wallet.walletTypeName} { wallet.defaultPaymentMethod ? Default : Set Default } {wallet.walletPrincipalName} { wallet?.walletTypeCode.indexOf("pay_per_use") >= 0 ? Pre-Auth Amount: : Current Balance: } {wallet.currentBalance} { utils.isNotEmpty(wallet.expiresDate) && Expires {wallet.expiresDate} } { wallet.walletTypeCode == "credit_wallet" && toTopupPage()}> {$t("wallet.topUp")} } ); export default ViewWallet; const styles = StyleSheet.create({ cardWallet: { height: 220, margin: 16, padding: 16, borderRadius: 16, ...ElevationObject(2), backgroundColor: colorPrimary }, walletName: { flex: 1, color: textLight, fontSize: 28, fontWeight: 'bold', paddingRight: 16 }, walletProvider: { color: textLight, fontSize: 22, }, walletLabel: { color: textLight, opacity: .9, fontSize: 16, paddingTop: 16 }, walletBalance: { color: textLight, fontSize: 24, paddingTop: 4, fontWeight: 'bold' }, setDefaultView: { height: 28, ...$padding(4, 12), borderRadius: 16, alignItems: 'center', flexDirection: 'row', ...ElevationObject(2), backgroundColor: 'rgba(0,0,0,.9)' }, defaultView: { height: 28, ...$padding(4, 12), borderRadius: 16, alignItems: 'center', flexDirection: 'row', backgroundColor: 'rgba(0,0,0,.5)' }, defaultText: { color: textLight, fontSize: 13, paddingLeft: 4 }, topupView: { paddingTop: 16, flexDirection: 'row' } })