diff --git a/src/assets/images/loading.png b/src/assets/images/loading.png new file mode 100644 index 0000000..143b18e Binary files /dev/null and b/src/assets/images/loading.png differ diff --git a/src/router/daxpay.ts b/src/router/daxpay.ts index 7610763..e78ee31 100644 --- a/src/router/daxpay.ts +++ b/src/router/daxpay.ts @@ -74,5 +74,13 @@ export const DaxPayRoute: RouteRecordRaw = { title: '支付失败页面', }, }, + { + path: '/PayExcessTime', + name: 'PayExcessTime', + component: () => import('@/views/daxpay/result/PayExcessTime.vue'), + meta: { + title: '支付超时页面', + }, + }, ], } diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 3585066..0fbf97a 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -87,17 +87,11 @@ const transform: AxiosTransform = { } // 接口请求成功,直接返回相应结果 - if (code === ResultEnum.SUCCESS) { + if (code) { return result } // 接口请求错误,统一提示错误信息 这里逻辑可以根据项目进行修改 const errorMsg = msg - - // 请求失败 - console.log(code) - if (code) { - showFailToast(errorMsg) - } throw new Error(errorMsg) }, diff --git a/src/views/daxpay/cashier/Cashier.api.ts b/src/views/daxpay/cashier/Cashier.api.ts index 92ffd1c..0eb585a 100644 --- a/src/views/daxpay/cashier/Cashier.api.ts +++ b/src/views/daxpay/cashier/Cashier.api.ts @@ -11,6 +11,17 @@ export function getOrderAndConfig(orderNo) { params: { orderNo, cashierType: 'h5' }, }) } +/** + * 发起支付 + */ +export function payOrder(data:payParam){ + return http.request>({ + url: '/unipay/gateway/pay', + method: 'POST', + data, + }) +} + /** * 收银台配置 @@ -38,7 +49,7 @@ export interface GatewayOrder { description?: string /** 金额(元) */ amount?: number - + expiredTime?: string; } /** * 聚合支付配置信息 @@ -85,3 +96,30 @@ export interface CashierConfig { /** 是否推荐 */ recommend?: boolean } + +/** + * 支付配置项参数 + */ +export interface payParam{ + // 订单号 + orderNo?:string, + //支付配置项ID + itemId?:number, + // 唯一标识 + openId?:string, + // 付款码 + anthCode?:string, +} +/** + * 支付配置项参数返回值 + */ +export interface payConfig{ + // 商户订单号 + bizOrderNo?:string, + // 订单号 + orderNo?:string, + //支付状态 + status?:string, + //支付参数体 + payBody?:string +} \ No newline at end of file diff --git a/src/views/daxpay/cashier/Cashier.vue b/src/views/daxpay/cashier/Cashier.vue index cc4ed90..31e0468 100644 --- a/src/views/daxpay/cashier/Cashier.vue +++ b/src/views/daxpay/cashier/Cashier.vue @@ -3,28 +3,22 @@
-
- {{ orderAndConfig.order.amount }} 元 -
+
{{ orderAndConfig.order.amount }} 元
剩余支付时间 - {{ orderTime.currentMiute }} + {{ orderTime.currentMinute }} : {{ orderTime.currentSeconds }}
-
- 标题: -
+
标题:
{{ orderAndConfig.order.title }}
-
- 订单编号: -
+
订单编号:
{{ orderAndConfig.order.orderNo }}
@@ -40,84 +34,152 @@ @click="payTypeClick(item)" >
- + + +

{{ item.name }}

推荐
- +
-
+
支付¥{{ orderAndConfig.order.amount }}
+
+ 支付¥{{ orderAndConfig.order.amount }} +
+
+ +
+
+ +
处理中,请耐心等待
+
diff --git a/src/views/daxpay/result/PayExcessTime.vue b/src/views/daxpay/result/PayExcessTime.vue new file mode 100644 index 0000000..0aff018 --- /dev/null +++ b/src/views/daxpay/result/PayExcessTime.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/views/daxpay/result/PayFail.vue b/src/views/daxpay/result/PayFail.vue index fe41b29..2085dbb 100644 --- a/src/views/daxpay/result/PayFail.vue +++ b/src/views/daxpay/result/PayFail.vue @@ -1,119 +1,118 @@ - - - + + + + + + \ No newline at end of file