From 8ed716c6e2ced746ac2d4ca8cacd902d2f6607f2 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 17:41:26 +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=BB=BB=E4=B8=80=E5=95=86=E5=93=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=B8=AD=E5=8D=B3=E7=A6=81=E7=94=A8=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 会员结算 canSubmit 由 !submitting 改为 !submittingProductId,与充点分支的 ctaDisabled 口径一致 - 避免充点在途时仍能提交会员结算、被 buyRechargeProduct 静默丢弃后直接关闭弹层 - 补充反向用例:泥点订单提交中时会员结算按钮禁用 --- .../index.test.tsx | 44 +++++++++++++++++++ .../PlatformProfileRechargeModal/index.tsx | 3 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx b/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx index 0c15d0211..86cc808b0 100644 --- a/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx +++ b/packages/shared/src/components/PlatformProfileRechargeModal/index.test.tsx @@ -530,6 +530,50 @@ describe('PlatformProfileRechargeModal', () => { ).toHaveProperty('disabled', true); }); + test('泥点订单提交中时会员结算入口禁用', async () => { + const user = userEvent.setup(); + const renderModal = (submittingProductId: string | null) => ( + + ); + + const { rerender } = render(renderModal(null)); + await user.click( + screen.getByRole('button', { name: 'Starter 月付 开通会员' }), + ); + + // 泥点订单提交中:会员结算 CTA 同样禁用,避免宿主守卫静默丢弃提交后直接关弹层。 + rerender(renderModal('points_60')); + expect( + within(screen.getByRole('dialog', { name: '确认订单' })).getByRole( + 'button', + { name: '支付 ¥39' }, + ), + ).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 390df4a4d..25764bb1c 100644 --- a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx +++ b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx @@ -1074,7 +1074,8 @@ function PlatformRechargeCheckoutDialog({ } const canSubmit = Boolean(plan) && - !submitting && + // 与充点分支一致:任一商品在途都禁用提交,避免静默无操作后直接关弹层。 + !submittingProductId && (!isUpgrade || Boolean(quoteForTarget)) && amountCents > 0;