feat: 订单列表基本功能
This commit is contained in:
@@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 导出认证服务实例
|
||||
|
||||
Reference in New Issue
Block a user