fix;提交、
This commit is contained in:
@@ -178,6 +178,7 @@ export default function OrderDetailPage() {
|
||||
order &&
|
||||
!canPay &&
|
||||
['PENDING_SHIP', 'PENDING_RECEIVE', 'COMPLETED', 'OUT_WAREHOUSE', 'SHIPPING'].includes(order.status);
|
||||
const canInvoice = order?.status === 'COMPLETED';
|
||||
const productTotal = Number(order?.productAmount ?? order?.payAmount ?? 0);
|
||||
const freightTotal = Number(order?.freightAmount ?? 0);
|
||||
|
||||
@@ -207,22 +208,6 @@ export default function OrderDetailPage() {
|
||||
}
|
||||
}
|
||||
|
||||
async function requestRefund() {
|
||||
if (!id || !canRefund) return;
|
||||
setConfirming(true);
|
||||
try {
|
||||
await request('USER_H5', `/trade/orders/${id}/refund-requests`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ remark: '用户申请退款' }),
|
||||
});
|
||||
await loadOrder();
|
||||
} catch (e) {
|
||||
window.alert(e instanceof Error ? e.message : '申请退款失败');
|
||||
} finally {
|
||||
setConfirming(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!order) return <div className="empty">加载中...</div>;
|
||||
|
||||
return (
|
||||
@@ -470,8 +455,21 @@ export default function OrderDetailPage() {
|
||||
联系客服
|
||||
</button>
|
||||
{canRefund && order?.status !== 'REFUNDING' && order?.status !== 'REFUNDED' && (
|
||||
<button type="button" className="order-detail-action-outline" disabled={confirming} onClick={requestRefund}>
|
||||
申请退款
|
||||
<button
|
||||
type="button"
|
||||
className="order-detail-action-outline"
|
||||
onClick={() => navigate(`/after-sale?orderId=${order.id}&type=REFUND`)}
|
||||
>
|
||||
申请售后
|
||||
</button>
|
||||
)}
|
||||
{canInvoice && (
|
||||
<button
|
||||
type="button"
|
||||
className="order-detail-action-outline"
|
||||
onClick={() => navigate(`/invoices/apply?orderId=${order.id}`)}
|
||||
>
|
||||
申请发票
|
||||
</button>
|
||||
)}
|
||||
{canPay && (
|
||||
|
||||
Reference in New Issue
Block a user