feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面

This commit is contained in:
zhanjunhao
2026-11-04 19:59:06 +08:00
parent 1fd4e084b6
commit 15192c433b
576 changed files with 18075 additions and 18912 deletions
+249 -465
View File
@@ -18,47 +18,35 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import {
Card,
Typography,
Button,
Input,
Spin,
Tooltip,
Skeleton,
Banner,
} from '@douyinfe/semi-ui';
import { IconGift } from '@douyinfe/semi-icons';
import {
CreditCard,
Wallet,
Coins,
Sparkles,
TrendingUp,
Gift,
Zap,
ExternalLink,
Receipt,
Headphones,
} from 'lucide-react';
import { Alert } from 'antd';
import { Button, Spin, Tooltip } from '@/components/ui';
import { Check } from 'lucide-react';
import {
AlipayBrandIcon,
WechatBrandIcon,
StripeBrandIcon,
PayPalBrandIcon,
} from '../../components/common/icons/BrandIcons';
import { getCurrencyConfig } from '../../helpers/render';
import AmountCard from './AmountCard';
import { useMinimumLoadingTime } from '../../hooks/common/useMinimumLoadingTime';
const { Text, Title } = Typography;
const formatCny = (value) =>
`¥${Number(value || 0).toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}`;
// 需要发票时的联系提示(原型:充值订单按钮下方)
export const InvoiceNote = ({ t }) => (
<p className='rc-invoice'>
{t('需要发票?')}
<span>{t('联系在线客服')}</span>
</p>
);
const RechargePanel = ({
t,
userState,
renderQuota,
renderQuotaWithAmount,
statusLoading,
balanceLoading,
enableOnlineTopUp,
enableWechatTopUp,
enableAlipayTopUp,
@@ -69,31 +57,20 @@ const RechargePanel = ({
creemPreTopUp,
presetAmounts,
selectedPreset,
selectedPresetObj,
selectPresetAmount,
formatLargeNumber,
priceRatio,
topUpCount,
minTopUp,
getAmount,
setTopUpCount,
setSelectedPreset,
setSelectedPresetObj,
renderAmount,
amount,
amountLoading,
payMethods,
preTopUp,
paymentLoading,
payWay,
redemptionCode,
setRedemptionCode,
topUp,
isSubmitting,
topUpLink,
openTopUpLink,
payPalQuote,
topupInfo,
}) => {
useMinimumLoadingTime(amountLoading);
const showBalanceSkeleton = useMinimumLoadingTime(balanceLoading);
// Creem 使用独立产品选择;其余渠道共用金额和支付方式区块。
const hasStandardOnlinePayment =
@@ -104,440 +81,247 @@ const RechargePanel = ({
enablePayPalTopUp;
const hasAnyOnlinePayment = hasStandardOnlinePayment || enableCreemTopUp;
// 渲染支付方式图标
const renderPayIcon = (type, color) => {
if (type === 'alipay') {
return <AlipayBrandIcon size={18} color='#1677FF' />;
} else if (type === 'wxpay') {
return <WechatBrandIcon size={18} color='#07C160' />;
} else if (type === 'stripe') {
return <StripeBrandIcon size={18} color='#635BFF' />;
} else if (type === 'paypal') {
return <PayPalBrandIcon size={18} />;
} else {
return (
<CreditCard size={18} color={color || 'var(--semi-color-text-2)'} />
);
}
// 与原逻辑一致的支付方式可用性判断
const isMethodDisabled = (method) => {
const minTopupVal = Number(method.min_topup) || 0;
const isStripe = method.type === 'stripe';
const isPayPal = method.type === 'paypal';
const isWechat = method.type === 'wxpay';
const isAlipay = method.type === 'alipay';
return (
(!enableOnlineTopUp &&
!isStripe &&
!isPayPal &&
!isWechat &&
!isAlipay) ||
(!enableStripeTopUp && isStripe) ||
(!enablePayPalTopUp && isPayPal) ||
(!enableWechatTopUp && isWechat) ||
(!enableAlipayTopUp && isAlipay) ||
minTopupVal > Number(topUpCount || 0)
);
};
// 渲染支付方式图标(微信为原型中的绿色圆点)
const renderPayIcon = (type) => {
if (type === 'alipay') return <AlipayBrandIcon size={16} color='#1677FF' />;
if (type === 'wxpay') return <i className='rc-pay-dot' />;
if (type === 'stripe') return <StripeBrandIcon size={16} color='#635BFF' />;
if (type === 'paypal') return <PayPalBrandIcon size={16} />;
return null;
};
// ---- 充值订单:仅由已选档位、金额与支付方式派生展示 ----
const { symbol } = getCurrencyConfig();
const preset = selectedPreset !== null ? selectedPresetObj : null;
const discount =
preset?.discount || topupInfo?.discount?.[preset?.value] || 1.0;
const isNewVersion = preset?.id !== undefined;
const originalPrice = preset
? isNewVersion
? preset.value
: preset.value * priceRatio
: 0;
const arrivalText = preset
? preset.label ||
(isNewVersion
? formatCny(preset.value)
: `${symbol}${Number(preset.value).toLocaleString('en-US')}`)
: '-';
const selectedMethod = payMethods?.find((method) => method.type === payWay);
const payPalQuoted = payWay === 'paypal' && payPalQuote;
// 应付金额:人民币取已计算的 amount;PayPal 取已获取的美元报价(原型中币种符号为小字)
const payable = !preset
? null
: payWay === 'paypal'
? payPalQuoted
? {
symbol: '$',
value: Number(payPalQuote.payAmount).toFixed(2),
unit: 'USD',
}
: null
: { symbol: '¥', value: formatCny(amount).slice(1) };
const canPay =
Boolean(preset) &&
Boolean(selectedMethod) &&
!isMethodDisabled(selectedMethod) &&
Boolean(payable);
if (statusLoading) {
return (
<div className='rc-loading'>
<Spin size='large' />
</div>
);
}
if (!hasAnyOnlinePayment) {
return (
<>
<Alert
type='info'
showIcon
message={t(
'管理员未开启在线充值功能,请联系管理员开启或使用兑换码充值。',
)}
/>
<InvoiceNote t={t} />
</>
);
}
return (
<div className='relative'>
{/* 外层发光效果 */}
<div className='absolute -inset-0.5 bg-gradient-to-br from-blue-400/20 via-brand-via/20 to-brand-to/20 rounded-[20px] blur-md opacity-60' />
<Card className='relative !rounded-2xl shadow-xl border border-white/60 dark:border-neutral-800/60 bg-white/70 dark:bg-neutral-900/70 backdrop-blur-xl h-full overflow-hidden'>
{/* 顶部装饰线 */}
<div className='absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-blue-500 via-brand-via to-brand-to' />
{/* 背景装饰 */}
<div className='absolute top-0 right-0 w-64 h-64 bg-gradient-to-br from-blue-400/10 to-brand-to/10 rounded-full blur-3xl -mr-32 -mt-32 pointer-events-none' />
<div className='absolute bottom-0 left-0 w-48 h-48 bg-gradient-to-br from-brand-from/10 to-brand-to/10 rounded-full blur-3xl -ml-24 -mb-24 pointer-events-none' />
<div className='relative'>
{/* 头部:余额展示 */}
<div className='flex items-center justify-between mb-4'>
<div className='flex items-center gap-3'>
<div className='relative'>
<div className='absolute -inset-1 bg-gradient-to-br from-blue-500/40 to-brand-to/40 rounded-xl blur-md' />
<div className='relative w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-brand-to flex items-center justify-center shadow-lg shadow-blue-500/30'>
<CreditCard size={20} className='text-white' />
</div>
<Sparkles
size={12}
className='absolute -top-1 -right-1 text-amber-400'
/>
</div>
<div>
<Title
heading={5}
className='!mb-0 bg-clip-text text-transparent bg-gradient-to-r from-blue-600 to-brand-to dark:from-blue-400 dark:to-brand-to'
>
{t('在线充值')}
</Title>
<Text type='tertiary' size='small'>
{t('多种支付方式,安全便捷')}
</Text>
</div>
</div>
<>
{hasStandardOnlinePayment && (
<section className='rc-section'>
<h3>{t('选择充值额度')}</h3>
<p className='rc-section-desc'>
{t('按需充值,余额可用于平台模型调用。')}
</p>
<div className='rc-amount-grid'>
{presetAmounts.slice(0, 8).map((item, index) => (
<AmountCard
key={index}
preset={item}
selected={selectedPreset === item.value}
onClick={() => selectPresetAmount(item)}
topupInfo={topupInfo}
priceRatio={priceRatio}
t={t}
/>
))}
</div>
{/* 余额卡片 */}
<div className='relative overflow-hidden bg-gradient-to-r from-blue-500 via-brand-via to-brand-to rounded-2xl p-4 mb-4 shadow-xl shadow-blue-500/20'>
{/* 装饰元素 */}
<div className='absolute top-0 right-0 w-32 h-32 bg-white/10 rounded-full -mr-8 -mt-8 blur-2xl' />
<div className='absolute bottom-0 left-0 w-24 h-24 bg-black/10 rounded-full -ml-8 -mb-8 blur-xl' />
<div className='rc-divider' />
<div className='relative z-10 flex items-center justify-between gap-4'>
{/* 左侧:余额信息 */}
<div className='flex items-center gap-3 min-w-0'>
<div className='p-2 bg-white/20 rounded-xl backdrop-blur-md flex-shrink-0'>
<Wallet size={18} className='text-white' />
</div>
<div className='min-w-0'>
<Text className='!text-white/80 text-xs font-medium'>
{t('当前余额')}
</Text>
<Skeleton
loading={showBalanceSkeleton}
placeholder={
<Skeleton.Title
style={{
width: 100,
height: 28,
backgroundColor: 'rgba(255,255,255,0.2)',
}}
/>
}
<h3>{t('支付方式')}</h3>
{payMethods && payMethods.length > 0 ? (
<div className='rc-pay-methods'>
{payMethods.map((method) => {
const minTopupVal = Number(method.min_topup) || 0;
const disabled = isMethodDisabled(method);
const selected = payWay === method.type;
const button = (
<Button
key={method.type}
onClick={() => preTopUp(method.type)}
disabled={disabled}
loading={paymentLoading && selected}
aria-pressed={selected}
icon={renderPayIcon(method.type)}
className={`rc-pay-method ${selected ? 'is-selected' : ''}`}
>
<Title
heading={4}
className='!text-white !mb-0 drop-shadow-sm truncate'
{method.name}
{selected && <Check size={14} />}
</Button>
);
if (disabled && minTopupVal > Number(topUpCount || 0)) {
return (
<Tooltip
key={method.type}
content={
t('此支付方式最低充值金额为') + ' ' + minTopupVal
}
>
{renderQuota(userState?.user?.quota)}
</Title>
</Skeleton>
</div>
</div>
{/* 分隔线 */}
<div className='w-px h-10 bg-white/20 flex-shrink-0' />
{/* 右侧:历史消耗 */}
<div className='flex items-center gap-3 min-w-0'>
<div className='p-2 bg-white/10 rounded-xl backdrop-blur-md flex-shrink-0'>
<TrendingUp size={18} className='text-white/80' />
</div>
<div className='min-w-0'>
<Text className='!text-white/60 text-xs'>
{t('历史消耗')}
</Text>
<Text className='!text-white font-semibold text-sm block truncate'>
{renderQuota(userState?.user?.used_quota)}
</Text>
</div>
</div>
</div>
</div>
{/* 开票服务公告 */}
<div className='relative mb-4 overflow-hidden rounded-xl border border-amber-200/80 dark:border-amber-700/40 bg-amber-50/80 dark:bg-amber-950/20 backdrop-blur-sm'>
{/* 左侧强调色条 */}
<div className='absolute left-0 top-0 bottom-0 w-1 bg-gradient-to-b from-amber-400 to-orange-400' />
<div className='flex items-center gap-3 pl-4 pr-4 py-3'>
{/* 图标区 */}
<div className='flex-shrink-0 w-9 h-9 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center shadow-md shadow-amber-400/30'>
<Receipt size={16} className='text-white' />
</div>
{/* 文字区 */}
<div className='flex-1 min-w-0'>
<div className='flex items-center gap-2 mb-0.5'>
<span className='text-xs font-bold text-amber-700 dark:text-amber-400 tracking-wide uppercase'>
{t('发票服务')}
</span>
<span className='text-[10px] px-1.5 py-0.5 rounded-full bg-amber-100 dark:bg-amber-900/50 text-amber-600 dark:text-amber-400 border border-amber-200 dark:border-amber-700/60 font-medium'>
{t('温馨提示')}
</span>
</div>
<Text
size='small'
className='!text-gray-600 dark:!text-gray-300 leading-relaxed'
>
{t('需要开发票的用户,请联系')}&nbsp;
<span className='inline-flex items-center gap-1 font-semibold text-amber-700 dark:text-amber-400'>
<Headphones size={12} />
{t('在线客服')}
</span>
&nbsp;{t('进行申请处理')}
</Text>
</div>
</div>
</div>
{statusLoading ? (
<div className='py-12 flex flex-col items-center justify-center'>
<Spin size='large' />
<Text type='tertiary' className='mt-4'>
{t('加载中...')}
</Text>
</div>
) : hasAnyOnlinePayment ? (
<div className='space-y-3.5'>
{/* 充值金额选择 */}
{hasStandardOnlinePayment && (
<div className='relative group'>
<div className='absolute -inset-0.5 bg-gradient-to-r from-emerald-400/20 to-teal-400/20 rounded-2xl blur-sm opacity-0 group-hover:opacity-100 transition-opacity' />
<div className='relative bg-white/50 dark:bg-neutral-800/40 backdrop-blur-md rounded-xl p-3.5 border border-white/70 dark:border-neutral-700/50 shadow-sm'>
<div className='flex items-center gap-2 mb-3'>
<div className='p-1.5 bg-gradient-to-br from-emerald-500 to-teal-500 rounded-lg shadow-md shadow-emerald-500/20'>
<Coins size={14} className='text-white' />
</div>
<Text strong className='text-gray-800 dark:text-gray-200'>
{t('选择充值金额')}
</Text>
</div>
<div className='grid grid-cols-2 sm:grid-cols-4 gap-2.5'>
{presetAmounts.slice(0, 8).map((preset, index) => (
<AmountCard
key={index}
preset={preset}
selected={selectedPreset === preset.value}
onClick={() => selectPresetAmount(preset)}
topupInfo={topupInfo}
priceRatio={priceRatio}
t={t}
/>
))}
</div>
</div>
</div>
)}
{/* 支付方式 */}
{hasStandardOnlinePayment && (
<div className='relative group'>
<div className='absolute -inset-0.5 bg-gradient-to-r from-brand-from/20 to-brand-to/20 rounded-2xl blur-sm opacity-0 group-hover:opacity-100 transition-opacity' />
<div className='relative bg-white/50 dark:bg-neutral-800/40 backdrop-blur-md rounded-xl p-3.5 border border-white/70 dark:border-neutral-700/50 shadow-sm'>
<div className='flex items-center gap-2 mb-3'>
<div className='p-1.5 bg-gradient-to-br from-brand-from to-brand-to rounded-lg shadow-md shadow-brand/20'>
<CreditCard size={14} className='text-white' />
</div>
<Text strong className='text-gray-800 dark:text-gray-200'>
{t('支付方式')}
</Text>
</div>
{payMethods && payMethods.length > 0 ? (
<div className='flex flex-wrap gap-3'>
{payMethods.map((method) => {
const minTopupVal = Number(method.min_topup) || 0;
const isStripe = method.type === 'stripe';
const isPayPal = method.type === 'paypal';
const isWechat = method.type === 'wxpay';
const isAlipay = method.type === 'alipay';
const disabled =
(!enableOnlineTopUp &&
!isStripe &&
!isPayPal &&
!isWechat &&
!isAlipay) ||
(!enableStripeTopUp && isStripe) ||
(!enablePayPalTopUp && isPayPal) ||
(!enableWechatTopUp && isWechat) ||
(!enableAlipayTopUp && isAlipay) ||
minTopupVal > Number(topUpCount || 0);
const button = (
<Button
key={method.type}
theme={payWay === method.type ? 'solid' : 'light'}
type={
payWay === method.type ? 'primary' : 'tertiary'
}
onClick={() => preTopUp(method.type)}
disabled={disabled}
loading={paymentLoading && payWay === method.type}
icon={renderPayIcon(method.type, method.color)}
className={`!rounded-xl !px-5 !py-2.5 !h-auto transition-all ${
payWay === method.type
? '!bg-gradient-to-r !from-brand-from !to-brand-to !shadow-lg !shadow-brand/30'
: 'hover:!bg-brand/5 dark:hover:!bg-brand-deep/20 hover:!border-brand-from'
}`}
>
{method.name}
</Button>
);
if (
disabled &&
minTopupVal > Number(topUpCount || 0)
) {
return (
<Tooltip
key={method.type}
content={
t('此支付方式最低充值金额为') +
' ' +
minTopupVal
}
>
{button}
</Tooltip>
);
}
return button;
})}
</div>
) : (
<div className='text-gray-500 text-sm p-4 bg-gray-100/50 dark:bg-gray-800/50 rounded-xl border border-dashed border-gray-300 dark:border-gray-600 flex items-center gap-2'>
<Zap size={16} className='text-gray-400' />
{t('暂无可用的支付方式,请联系管理员配置')}
</div>
)}
</div>
</div>
)}
{/* Creem 充值 */}
{enableCreemTopUp && creemProducts.length > 0 && (
<div className='relative group'>
<div className='absolute -inset-0.5 bg-gradient-to-r from-cyan-400/20 to-blue-400/20 rounded-2xl blur-sm opacity-0 group-hover:opacity-100 transition-opacity' />
<div className='relative bg-white/50 dark:bg-neutral-800/40 backdrop-blur-md rounded-xl p-3.5 border border-white/70 dark:border-neutral-700/50 shadow-sm'>
<div className='flex items-center gap-2 mb-3'>
<div className='p-1.5 bg-gradient-to-br from-cyan-500 to-blue-500 rounded-lg shadow-md shadow-cyan-500/20'>
<Zap size={14} className='text-white' />
</div>
<Text strong className='text-gray-800 dark:text-gray-200'>
{t('Creem 充值')}
</Text>
</div>
<div className='grid grid-cols-2 sm:grid-cols-3 gap-3'>
{creemProducts.map((product, index) => (
<div
key={index}
onClick={() => creemPreTopUp(product)}
className='cursor-pointer rounded-xl p-4 bg-white dark:bg-neutral-900 border border-gray-200 dark:border-neutral-700 transition-all hover:shadow-lg hover:border-cyan-300 dark:hover:border-cyan-700 hover:scale-[1.02] text-center'
>
<Text
strong
className='block text-gray-800 dark:text-gray-200'
>
{product.name}
</Text>
<div className='text-xs text-gray-500 my-2'>
{t('额度')}: {product.quota}
</div>
<Text className='text-lg font-bold bg-clip-text text-transparent bg-gradient-to-r from-cyan-600 to-blue-600'>
{product.currency === 'EUR' ? '€' : '¥'}
{product.price}
</Text>
</div>
))}
</div>
</div>
</div>
)}
{/* 分隔线 */}
<div className='h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-gray-700 to-transparent' />
{/* 兑换码充值 */}
<div className='relative group'>
<div className='absolute -inset-0.5 bg-gradient-to-r from-amber-400/20 to-orange-400/20 rounded-2xl blur-sm opacity-0 group-hover:opacity-100 transition-opacity' />
<div className='relative bg-white/50 dark:bg-neutral-800/40 backdrop-blur-md rounded-xl p-3.5 border border-white/70 dark:border-neutral-700/50 shadow-sm'>
<div className='flex items-center gap-2 mb-3'>
<div className='p-1.5 bg-gradient-to-br from-amber-500 to-orange-500 rounded-lg shadow-md shadow-amber-500/20'>
<Gift size={14} className='text-white' />
</div>
<Text strong className='text-gray-800 dark:text-gray-200'>
{t('兑换码充值')}
</Text>
</div>
<div className='flex gap-3'>
<Input
prefix={<IconGift className='text-amber-500' />}
placeholder={t('请输入兑换码')}
value={redemptionCode}
onChange={(value) => setRedemptionCode(value)}
showClear
className='flex-1 !rounded-xl'
style={{ flex: 1 }}
/>
<Button
theme='solid'
onClick={topUp}
loading={isSubmitting}
className='!bg-gradient-to-r !from-amber-500 !to-orange-500 !rounded-xl !px-6 !shadow-lg !shadow-amber-500/20 hover:!shadow-amber-500/30 transition-all'
>
{t('兑换')}
</Button>
</div>
{topUpLink && (
<div className='mt-2 flex items-center gap-1'>
<Text type='tertiary' size='small'>
{t('在找兑换码?')}
</Text>
<Text
link
onClick={openTopUpLink}
className='cursor-pointer flex items-center gap-1 text-amber-600 hover:text-amber-700'
>
{t('购买兑换码')}
<ExternalLink size={12} />
</Text>
</div>
)}
</div>
</div>
{button}
</Tooltip>
);
}
return button;
})}
</div>
) : (
<div className='space-y-3.5'>
{/* 提示信息 */}
<Banner
type='info'
description={t(
'管理员未开启在线充值功能,请联系管理员开启或使用兑换码充值。',
)}
className='!rounded-xl'
closeIcon={null}
/>
{/* 分隔线 */}
<div className='h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-gray-700 to-transparent' />
{/* 兑换码充值 */}
<div className='relative group'>
<div className='absolute -inset-0.5 bg-gradient-to-r from-amber-400/20 to-orange-400/20 rounded-2xl blur-sm opacity-0 group-hover:opacity-100 transition-opacity' />
<div className='relative bg-white/50 dark:bg-neutral-800/40 backdrop-blur-md rounded-xl p-3.5 border border-white/70 dark:border-neutral-700/50 shadow-sm'>
<div className='flex items-center gap-2 mb-3'>
<div className='p-1.5 bg-gradient-to-br from-amber-500 to-orange-500 rounded-lg'>
<Gift size={14} className='text-white' />
</div>
<Text strong className='text-gray-800 dark:text-gray-200'>
{t('兑换码充值')}
</Text>
</div>
<div className='flex gap-3'>
<Input
prefix={<IconGift className='text-amber-500' />}
placeholder={t('请输入兑换码')}
value={redemptionCode}
onChange={(value) => setRedemptionCode(value)}
showClear
className='flex-1 !rounded-xl'
style={{ flex: 1 }}
/>
<Button
theme='solid'
onClick={topUp}
loading={isSubmitting}
className='!bg-gradient-to-r !from-amber-500 !to-orange-500 !rounded-xl !px-6 !shadow-lg !shadow-amber-500/20 hover:!shadow-amber-500/30 transition-all'
>
{t('兑换')}
</Button>
</div>
{topUpLink && (
<div className='mt-2 flex items-center gap-1'>
<Text type='tertiary' size='small'>
{t('在找兑换码?')}
</Text>
<Text
link
onClick={openTopUpLink}
className='cursor-pointer flex items-center gap-1 text-amber-600 hover:text-amber-700'
>
{t('购买兑换码')}
<ExternalLink size={12} />
</Text>
</div>
)}
</div>
</div>
<div className='rc-pay-empty'>
{t('暂无可用的支付方式,请联系管理员配置')}
</div>
)}
</div>
</Card>
</div>
</section>
)}
{/* Creem 充值 */}
{enableCreemTopUp && creemProducts.length > 0 && (
<section className='rc-section rc-section-gap'>
<h3>{t('Creem 充值')}</h3>
<div className='rc-amount-grid'>
{creemProducts.map((product, index) => (
<button
key={index}
type='button'
onClick={() => creemPreTopUp(product)}
className='rc-amount'
>
<span className='rc-amount-value'>{product.name}</span>
<span className='rc-amount-pay'>
{t('额度')}: {product.quota}
</span>
<span className='rc-amount-bonus'>
{product.currency === 'EUR' ? '€' : '¥'}
{product.price}
</span>
</button>
))}
</div>
</section>
)}
{hasStandardOnlinePayment && (
<section className='rc-order'>
<div className='rc-order-main'>
<h3 className='rc-order-title'>{t('充值订单')}</h3>
<dl className='rc-order-rows'>
<div>
<dt>{t('到账额度')}</dt>
<dd>{arrivalText}</dd>
</div>
<div>
<dt>{t('优惠金额')}</dt>
<dd>
{preset ? formatCny(originalPrice * (1 - discount)) : '-'}
</dd>
</div>
<div>
<dt>{t('支付方式')}</dt>
<dd>{selectedMethod?.name || '-'}</dd>
</div>
{payPalQuoted && (
<div>
<dt>{t('支付服务费')}</dt>
<dd>{`$${Number(payPalQuote.serviceFee).toFixed(2)} USD`}</dd>
</div>
)}
</dl>
</div>
<div className='rc-order-side'>
<span className='rc-label'>{t('应付金额')}</span>
<strong className='rc-order-amount'>
{payable ? (
<>
<small>{payable.symbol}</small>
{payable.value}
{payable.unit && (
<small className='rc-order-unit'>{payable.unit}</small>
)}
</>
) : (
'-'
)}
</strong>
{/* 与点击支付方式相同:进入原有的预充值校验与确认弹窗 */}
<Button
type='primary'
block
disabled={!canPay}
loading={paymentLoading}
onClick={() => preTopUp(payWay)}
>
{t('立即充值')}
</Button>
<InvoiceNote t={t} />
</div>
</section>
)}
</>
);
};