From fe04ee3d1a18519ca71772dbedc5e6f681b67386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com> Date: Fri, 29 May 2026 14:25:24 +0800 Subject: [PATCH] 11 --- src/api/shoppingCart.ts | 22 +++++++++++++++ src/views/pay/payment.vue | 58 ++++++++++++++++++++++++++++----------- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/src/api/shoppingCart.ts b/src/api/shoppingCart.ts index e09abf1..dab437d 100644 --- a/src/api/shoppingCart.ts +++ b/src/api/shoppingCart.ts @@ -67,3 +67,25 @@ export const CreateOrder = (data, loading?: boolean) => { loading }) } + +/** + * 获取订单状态 + * @param { String } paymentId - 订单ID + * @param loading - 是否显示loading + * @returns + */ +export const GetOrderStatus = (paymentId: string, loading?: boolean) => { + return request({ + url: `/buyer/buyer/payment/status/${paymentId}`, + method: 'get', + loading + }) +} +export const ORDER_STATUS = { + PENDING: 0,//待支付 + SUCCESS: 1,//支付成功 + FAILED: 2,//支付失败 + CANCELED: 3,//已取消支付 + PARTIAL_REFUND: 4,//已部分退款 + FULL_REFUND: 5,//已全额退款 +} diff --git a/src/views/pay/payment.vue b/src/views/pay/payment.vue index 04b744c..3a88853 100644 --- a/src/views/pay/payment.vue +++ b/src/views/pay/payment.vue @@ -4,13 +4,13 @@ Payment Details -
+
Credit / Debit Card
-
+
I agree to the Terms & Conditions and Privacy Policy. @@ -18,11 +18,11 @@
-
+
Pay with Paypal
-