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({