From f07e115e5d415c71bccd564d4f28f1abc37cbc67 Mon Sep 17 00:00:00 2001
From: TianYu <332368756@qq.com>
Date: Fri, 26 May 2023 16:28:53 +0800
Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DBUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/aliPayLinkCopy/index.vue | 51 +++
yudao-ui-app/libs/pay.js | 8 +-
yudao-ui-app/pages/goods_cashier/index.vue | 416 ++----------------
3 files changed, 94 insertions(+), 381 deletions(-)
create mode 100644 yudao-ui-app/components/aliPayLinkCopy/index.vue
diff --git a/yudao-ui-app/components/aliPayLinkCopy/index.vue b/yudao-ui-app/components/aliPayLinkCopy/index.vue
new file mode 100644
index 000000000..4989ee3f9
--- /dev/null
+++ b/yudao-ui-app/components/aliPayLinkCopy/index.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+ 链接已复制,请到外部浏览器完成支付
+
+
+
+
+
+
+
+
diff --git a/yudao-ui-app/libs/pay.js b/yudao-ui-app/libs/pay.js
index a6635551f..b97635492 100644
--- a/yudao-ui-app/libs/pay.js
+++ b/yudao-ui-app/libs/pay.js
@@ -7,6 +7,11 @@ const payTypes = ['WXPAY', 'ALIPAY']
* @param payInfo // 支付下单信息
* @param payType // 支付类型
* @param createOrderFun // 预下单方法
+ * @param payResultHandle // 支付参数返回处理方法,不同的业务逻辑下单后返回的支付参数字段可能不一样,需要处理成统一格式
+ * {
+ jsapiResult: '', 微信jsapi支付参数
+ body: '', 支付宝支付参数
+ }
* @param wxPaySuccess // 微信支付下单支付成功回调
* @param aliPaySuccess // 支付宝支付下单成功回调
*/
@@ -15,6 +20,7 @@ const unityPay = (options) => {
payInfo: {},
payType: '',
createOrderFun: () => {},
+ payResultHandle: (res) => res,
wxPaySuccess: () => {},
aliPaySuccess: () => {}
}
@@ -43,7 +49,7 @@ const unityPay = (options) => {
..._options.payInfo,
payType: _options.payType
}).then(res => {
- const payConfig = res.data
+ const payConfig = _options.payResultHandle(res.data)
switch (_options.payType) {
// 微信JSAPI支付
case 'WXPAY':
diff --git a/yudao-ui-app/pages/goods_cashier/index.vue b/yudao-ui-app/pages/goods_cashier/index.vue
index fd0d3fac3..5e6a75690 100644
--- a/yudao-ui-app/pages/goods_cashier/index.vue
+++ b/yudao-ui-app/pages/goods_cashier/index.vue
@@ -17,7 +17,7 @@
请选择支付方式
+ v-show='item.payStatus' @click="payType(item.value, index)">
@@ -52,51 +52,53 @@
-
+
+