feat: 订单列表基本功能

This commit is contained in:
2025-09-11 22:51:11 +08:00
parent c86e20c316
commit 57613ec8fe
8 changed files with 504 additions and 79 deletions

View File

@@ -16,6 +16,12 @@ export enum OrderStatus {
FINISHED,
}
export enum CancelType {
NONE = 0, // 未取消
USER, // 用户主动取消
TIMEOUT, // 超时
}
export interface PayMentParams {
order_id: number;
order_no: string;
@@ -119,6 +125,42 @@ class OrderService {
},
);
}
// 取消未支付订单
async cancelUnpaidOrder({
order_no,
cancel_reason,
}: {
order_no: number;
cancel_reason: string;
}): Promise<ApiResponse<any>> {
return httpService.post(
"/payment/cancel_order",
{ order_no, cancel_reason },
{
showLoading: true,
},
);
}
// 申请退款
async applicateRefund({
order_no,
refund_reason,
refund_amount,
}: {
order_no: number;
refund_reason: string;
refund_amount: number;
}): Promise<ApiResponse<any>> {
return httpService.post(
"/payment/apply_refund",
{ order_no, refund_reason, refund_amount },
{
showLoading: true,
},
);
}
}
// 导出认证服务实例