From 9e13b83171056502afb9ed5d693579c8a20a299e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sun, 4 Oct 2026 15:52:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=85=85=E5=80=BC=E5=BC=B9=E7=AA=97):?= =?UTF-8?q?=20=E6=91=8A=E5=B9=B3=E5=A5=97=E9=A4=90=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E9=87=8C=E7=9A=84=E5=B5=8C=E5=A5=97=E4=B8=89=E5=85=83=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 原年付实付文案在模板字符串里再嵌一层 savingCents 三元,属于嵌套三元 - 把年付价格行提升为 annualPriceLine 常量,JSX 只保留 annual 单层分支,文案不变 --- .../src/components/PlatformProfileRechargeModal/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx index e5341e48b..c81eb11f6 100644 --- a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx +++ b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx @@ -701,6 +701,9 @@ function PlatformMembershipPlanCard({ const savingCents = annual ? Math.max(0, plan.monthPriceCents * 12 - plan.yearPriceCents) : 0; + const annualPriceLine = `年实付 ${formatRechargePrice(plan.yearPriceCents)}${ + savingCents > 0 ? ` · 省 ${formatRechargePrice(savingCents)}` : '' + }`; // 按钮文案优先级:不可购买时展示业务文案,其次「处理中」,最后默认「选择并确认」。 let actionButtonLabel = '选择并确认'; if (disabled) { @@ -739,9 +742,7 @@ function PlatformMembershipPlanCard({
{annual - ? `年实付 ${formatRechargePrice(plan.yearPriceCents)}${ - savingCents > 0 ? ` · 省 ${formatRechargePrice(savingCents)}` : '' - }` + ? annualPriceLine : `每次支付 ${formatRechargePrice(listPriceCents)},有效期 1 个月`}