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
+5 -33
View File
@@ -305,25 +305,6 @@ export default function ProxyOrderPage() {
}
}
async function handleMockConfirm() {
if (!created) return;
setPaying(true);
try {
await request('PARTNER_H5', `/partner/proxy-orders/${created.id}/pay/mock-confirm`, {
method: 'POST',
body: '{}',
silent: true,
});
stopPoll();
toastSuccess('支付成功');
navigate(`/center/proxy-orders/${created.id}`, { replace: true });
} catch (e) {
setMsg(e instanceof Error ? e.message : '模拟支付失败');
} finally {
setPaying(false);
}
}
const selectedProduct = options?.products.find((p) => p.id === productId);
const deliveryLabel =
preview?.deliveryType === 'ON_SITE_PICKUP'
@@ -382,21 +363,21 @@ export default function ProxyOrderPage() {
<p className="label-md text-muted">{paying ? '生成收款码中…' : '暂无收款码'}</p>
)}
<p className="label-md text-muted" style={{ marginTop: 8 }}>
使
使
</p>
<button
type="button"
className="btn btn-primary btn-block"
className="btn btn-block"
style={{ marginTop: 16 }}
disabled={paying}
onClick={() => void handleMockConfirm()}
onClick={() => void startPay(created.id, 'NATIVE')}
>
{paying ? '处理中…' : '模拟支付成功'}
{paying ? '生成中…' : '重新生成收款码'}
</button>
</div>
) : (
<div style={{ marginTop: 16 }}>
<p className="label-md text-muted"> Mock </p>
<p className="label-md text-muted"></p>
<button
type="button"
className="btn btn-primary btn-block"
@@ -406,15 +387,6 @@ export default function ProxyOrderPage() {
>
{paying ? '支付中…' : '重新调起微信代付'}
</button>
<button
type="button"
className="btn btn-block"
style={{ marginTop: 8 }}
disabled={paying}
onClick={() => void handleMockConfirm()}
>
</button>
</div>
)}