接口返回了正常的jsConfig,
看代碼邏輯應(yīng)該是走了goods/cashier/index.vue 385行的邏輯
uni[mp_pay_name]方法走了fail邏輯 ,這種情況如何處理。如何才能正常的完成微信支付
打包后的程序在微信開發(fā)者工具中編譯后,在支付訂單頁面點擊確認支付的時候,出現(xiàn)一個支付中的loading后彈出了一個toast 取消支付 然后自動跳轉(zhuǎn)到了訂單支付失敗頁面。
case 'WECHAT_PAY':
console.log('進入到微信支付')
that.toPay = true;
// #ifdef MP
/* that.toPay = true; */
let mp_pay_name = ''
if (uni.requestOrderPayment) {
mp_pay_name = 'requestOrderPayment'
} else {
mp_pay_name = 'requestPayment'
}
uni[mp_pay_name]({
timeStamp: jsConfig.timestamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.package,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
uni.hideLoading();
if (that.BargainId || that.combinationId || that.pinkId ||
that
.seckillId || that.discountId)
return that.$util.Tips({
title: that.$t(`支付成功`),
icon: 'success'
}, {
tab: 4,
url: goPages
});
return that.$util.Tips({
title: that.$t(`支付成功`),
icon: 'success'
}, {
tab: 5,
url: goPages
});
},
fail: function(e) {
uni.hideLoading();
return that.$util.Tips({
title: that.$t(`取消支付`)
}, {
tab: 5,
url: goPages + '&status=2'
});
},
complete: function(e) {
uni.hideLoading();
//關(guān)閉當(dāng)前頁面跳轉(zhuǎn)至訂單狀態(tài)
if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
'requestOrderPayment:cancel') return that.$util
.Tips({
title: that.$t(`取消支付`)
}, {
tab: 5,
url: goPages + '&status=2'
});
},
})