From df6da6c27e1698cfd560051d7ed4e1b053939107 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Tue, 26 Dec 2023 12:37:09 +0800 Subject: [PATCH] 等级卡bug的优化 --- pages/user/plus/plus.js | 16 ++++++++++++++-- utils/pay2.js | 7 ++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index e77e9a6..b546a81 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -531,8 +531,20 @@ Page({ } else { t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); t_pay.pay(req, th.success, function (msg) { - if(!msg) msg='支付失败'; - getApp().my_warnning(msg, 0, th); + + if( typeof msg === 'object' && msg !== null && msg.code==-2){ + wx.showModal({ + title: msg.msg, + showCancel: !1, + complete: function () { + getApp().goto('/packageE/pages/user/cardinfo/cardinfo'); + } + }); + }else{ + if(!msg) msg='支付失败'; + getApp().my_warnning(msg, 0, th); + } + th.setData({ is_select:0, focus:true, diff --git a/utils/pay2.js b/utils/pay2.js index 25decb8..c87aee5 100644 --- a/utils/pay2.js +++ b/utils/pay2.js @@ -88,7 +88,12 @@ module.exports = { i.weixinPay(t.data.data, succ, fail); } } - }else{ + } + else if(t.data.code==-2 && dd.rechargeType==3){ + i.wx_paying=0; + "function" == typeof fail && fail(t.data); + } + else{ i.wx_paying=0; "function" == typeof fail && fail(t.data.msg); } -- libgit2 0.21.4