From abcc6b3eaa590006356483fbaaefb3f9417ba5ee Mon Sep 17 00:00:00 2001 From: sunday <153788231@qq.com> Date: Sun, 26 Nov 2023 12:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/yz_pay.js | 56 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/src/utils/yz_pay.js b/src/utils/yz_pay.js index 4ac42f8..4c87093 100644 --- a/src/utils/yz_pay.js +++ b/src/utils/yz_pay.js @@ -973,9 +973,6 @@ export const yzPay = { // Toast("还在请求支付,请等待~"); // return; // } - console.log(type); - - this.isclick = true; if (type == 1) { if(this.$route.params.tag == 'auth'){ @@ -1196,10 +1193,55 @@ export const yzPay = { return } } else { - // 新整合支付方式,后端进行归类 - // 按返回的类型进行处理 - console.log('走新整合支付方式===='); - this.newPayQuick({ order_pay_id: this.order_pay_id, code: btn.code ,pay_type_id:type}); + switch (btn.code) { + case 'T_JSAPI': + case 'T_MINIAPP': + case 'T_H5': + case 'T_APP': + case 'T_NATIVE': + case 'A_JSAPI': + case 'A_NATIVE': + case 'U_NATIVE': + case 'U_JSAPI': + case 'D_NATIVE': + this.HfPay({ order_pay_id: this.order_pay_id, code: btn.code ,pay_type_id:type}) + break; + default: + // 新整合支付方式,后端进行归类 + // 按返回的类型进行处理 + console.log('走新整合支付方式===='); + this.newPayQuick({ order_pay_id: this.order_pay_id, code: btn.code ,pay_type_id:type}); + } + } + }, + async HfPay(params){ //汇付支付 + let {msg, result, data} = await $http.get("order.merge-pay.hfPay", params, "."); + if (result == 0) { + return this.$dialog.alert({ + message: msg + }).then(() => { + this.isclick = false; + }); + } + try { + console.log(data); + switch (data.mode) { + case '200': //微信公众支付 + console.log(data); + let pay_info=JSON.parse(data.pay_info); + console.log(pay_info); + this.newWXPay(pay_info); + break; + case '201': + // console.log() + this.navigationURL({url: data.qr_code});// 1 : 直接跳转url + break; + default: + console.log('找不到对应类型的支付方式,请核实!'); + break; + } + } catch (error) { + this.isclick = false; } }, async newPayQuick(params = {}){