fix(proxy-order): remove mock pay button, use real WeChat pay

This commit is contained in:
2026-08-02 13:28:09 +08:00
parent ab3b230d01
commit 4ba51c502b
3 changed files with 183 additions and 81 deletions
@@ -63,7 +63,6 @@ export default function ProxyOrderModal({ open, onClose, onSuccess }: ProxyOrder
const [created, setCreated] = useState<ProxyOrderCreateResponse | null>(null);
const [codeUrl, setCodeUrl] = useState<string | null>(null);
const [payLoading, setPayLoading] = useState(false);
const [mockConfirming, setMockConfirming] = useState(false);
const pollRef = useRef<number | null>(null);
const region = useMemo(() => parseRegionCodes(regionCodes), [regionCodes]);
@@ -215,26 +214,6 @@ export default function ProxyOrderModal({ open, onClose, onSuccess }: ProxyOrder
}
}
async function handleMockConfirm() {
if (!created) return;
setMockConfirming(true);
try {
const st = await request<PayStatus>(`/admin/proxy-orders/${created.id}/pay/mock-confirm`, {
method: 'POST',
body: '{}',
});
stopPoll();
message.success(`支付成功:${st.orderNo}`);
const payload = { id: st.id, orderNo: st.orderNo };
resetForm();
onSuccess(payload);
} catch (e) {
message.error(e instanceof Error ? e.message : '模拟支付失败');
} finally {
setMockConfirming(false);
}
}
const deliveryLabel =
preview?.deliveryType === 'ON_SITE_PICKUP'
? '现场提货'
@@ -253,9 +232,6 @@ export default function ProxyOrderModal({ open, onClose, onSuccess }: ProxyOrder
step === 'pay' ? (
<Space>
<Button onClick={handleClose}></Button>
<Button type="primary" loading={mockConfirming} onClick={() => void handleMockConfirm()}>
</Button>
</Space>
) : (
<Space>
@@ -285,7 +261,7 @@ export default function ProxyOrderModal({ open, onClose, onSuccess }: ProxyOrder
) : codeUrl ? (
<Space direction="vertical" size={12} align="center">
<QRCode value={codeUrl} size={200} />
<Typography.Text type="secondary">使</Typography.Text>
<Typography.Text type="secondary">使</Typography.Text>
<Typography.Text type="secondary" style={{ fontSize: 12, wordBreak: 'break-all' }}>
{codeUrl}
</Typography.Text>