From e87837381a7ccfc77521b31381a5fbe025d78fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Mon, 5 Oct 2026 14:10:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D(=E5=85=85=E5=80=BC=E5=BC=B9?= =?UTF-8?q?=E5=B1=82):=20=E4=B8=8B=E5=8D=95=E8=BF=9B=E8=A1=8C=E4=B8=AD?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=B3=A5=E7=82=B9=E7=BB=93=E7=AE=97=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 会员订单提交时泥点结算 CTA 仍可点,点击后会被宿主 buyRechargeProduct 守卫静默丢弃 - 泥点结算弹层传 ctaDisabled,底部「充值」CTA 也在任意提交进行中禁用 - 保留上一轮「会员提交不波及泥点档位可选性」的既有行为,仅收口下单动作;补回归测试 --- .../index.test.tsx | 50 +++++++++++++++++++ .../PlatformProfileRechargeModal/index.tsx | 5 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx b/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx index c1c5d6b41..0c15d0211 100644 --- a/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx +++ b/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx @@ -480,6 +480,56 @@ describe('PlatformProfileRechargeModal', () => { }); }); + test('会员订单提交中时泥点档位仍可选,但下单入口禁用', async () => { + const user = userEvent.setup(); + const renderModal = (submittingProductId: string | null) => ( + + ); + + const { rerender } = render(renderModal(null)); + await user.click(screen.getByRole('tab', { name: '泥点充值' })); + const product = within( + screen.getByRole('radiogroup', { name: '泥点充值档位' }), + ).getByRole('radio', { name: '60泥点 ¥6' }); + // 既有行为:会员订单提交不波及泥点档位的可选状态。 + expect(product).not.toHaveProperty('disabled', true); + + await user.click(product); + await user.click(screen.getByRole('button', { name: '充值 ¥6' })); + + // 会员订单提交中:泥点结算 CTA 禁用,避免被宿主守卫静默丢弃。 + rerender(renderModal('membership-pro-monthly')); + expect( + within(screen.getByRole('dialog', { name: '确认订单' })).getByRole( + 'button', + { name: '充值 ¥6' }, + ), + ).toHaveProperty('disabled', true); + }); + test('shows the empty state when the recharge tab has no point product', async () => { const user = userEvent.setup(); diff --git a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx index 9d2451282..390df4a4d 100644 --- a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx +++ b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx @@ -1019,6 +1019,7 @@ function PlatformRechargeCheckoutDialog({ submitting={submitting} amountCents={product.priceCents} ctaLabel={`充值 ${formatRechargePrice(product.priceCents)}`} + ctaDisabled={Boolean(submittingProductId)} onClose={onClose} onSubmit={() => { onBuy(product); @@ -1575,7 +1576,9 @@ export function PlatformProfileRechargeModal({ /> { if (selectedPointProduct) { setCheckout({