diff --git a/web/classic/src/components/topup/index.jsx b/web/classic/src/components/topup/index.jsx index 4d89253ba350..90203945406f 100644 --- a/web/classic/src/components/topup/index.jsx +++ b/web/classic/src/components/topup/index.jsx @@ -26,6 +26,7 @@ import { showSuccess, renderQuota, renderQuotaWithAmount, + getCurrencyConfig, copy, getQuotaPerUnit, } from '../../helpers'; @@ -800,8 +801,17 @@ const TopUp = () => { } }, [statusState?.status]); + const formatPaymentAmount = (value) => { + const { symbol } = getCurrencyConfig(); + const numericValue = Number(value); + const displayValue = Number.isFinite(numericValue) + ? numericValue.toFixed(2) + : value; + return `${symbol}${displayValue}`; + }; + const renderAmount = () => { - return amount + ' ' + t('元'); + return formatPaymentAmount(amount); }; const getAmount = async (value) => { @@ -928,6 +938,7 @@ const TopUp = () => { renderQuotaWithAmount={renderQuotaWithAmount} amountLoading={amountLoading} renderAmount={renderAmount} + formatPaymentAmount={formatPaymentAmount} payWay={payWay} payMethods={confirmPayMethods} amountNumber={amount} diff --git a/web/classic/src/components/topup/modals/PaymentConfirmModal.jsx b/web/classic/src/components/topup/modals/PaymentConfirmModal.jsx index f1c53c1219af..82fad4e45a3f 100644 --- a/web/classic/src/components/topup/modals/PaymentConfirmModal.jsx +++ b/web/classic/src/components/topup/modals/PaymentConfirmModal.jsx @@ -34,6 +34,7 @@ const PaymentConfirmModal = ({ renderQuotaWithAmount, amountLoading, renderAmount, + formatPaymentAmount, payWay, payMethods, // 新增:用于显示折扣明细 @@ -97,7 +98,7 @@ const PaymentConfirmModal = ({ {t('原价')}: - {`${originalAmount.toFixed(2)} ${t('元')}`} + {formatPaymentAmount(originalAmount)}
@@ -105,7 +106,7 @@ const PaymentConfirmModal = ({ {t('优惠')}: - {`- ${discountAmount.toFixed(2)} ${t('元')}`} + {`- ${formatPaymentAmount(discountAmount)}`}