00ff425e03
新增 SpacetimeDB 原生充值订单过期 timer 与 expired 状态。 移除 api-server 轮询 worker,改为 HTTP 角色订阅 Pending 到 Expired 事件并查单补偿。 统一微信下单 5 分钟 time_expire,并恢复前端支付通道选择与 expired 展示。 补齐生成绑定、前后端契约、测试和项目文档。
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { PlatformAcknowledgeStatusDialog } from '../common/PlatformAcknowledgeStatusDialog';
|
|
import { PlatformStatusDialog } from '../common/PlatformStatusDialog';
|
|
import type { RechargePaymentResult } from './usePlatformProfileCenterController';
|
|
|
|
const PROFILE_MODAL_OVERLAY_CLASS =
|
|
'platform-modal-backdrop !items-center !justify-center !px-4 !py-6';
|
|
|
|
export function PlatformRechargePaymentResultDialog({
|
|
result,
|
|
onClose,
|
|
}: {
|
|
result: RechargePaymentResult;
|
|
onClose: () => void;
|
|
}) {
|
|
const status =
|
|
result.kind === 'success'
|
|
? 'success'
|
|
: result.kind === 'pending'
|
|
? 'loading'
|
|
: result.kind === 'cancel' || result.kind === 'expired'
|
|
? 'cancel'
|
|
: 'error';
|
|
|
|
return (
|
|
<PlatformAcknowledgeStatusDialog
|
|
status={status}
|
|
title={result.title}
|
|
description={result.message}
|
|
onClose={onClose}
|
|
actionSurface="profile"
|
|
zIndexClassName="z-[90]"
|
|
overlayClassName={PROFILE_MODAL_OVERLAY_CLASS}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function PlatformRechargePaymentConfirmationMask({
|
|
orderId,
|
|
}: {
|
|
orderId: string;
|
|
}) {
|
|
return (
|
|
<PlatformStatusDialog
|
|
status="confirming"
|
|
title="正在确认支付"
|
|
description={`订单 ${orderId} 正在同步到账状态,请先停留在当前页面。`}
|
|
onClose={() => undefined}
|
|
closeDisabled
|
|
zIndexClassName="z-[95]"
|
|
overlayClassName={PROFILE_MODAL_OVERLAY_CLASS}
|
|
/>
|
|
);
|
|
}
|