From d98e420aa08a6b9c3bb324aeec35dbdbdc739db8 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 25 Aug 2021 17:14:07 +0800 Subject: [PATCH] 支付的修改 --- utils/pay.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/pay.js b/utils/pay.js index 8cb70d5..924f420 100644 --- a/utils/pay.js +++ b/utils/pay.js @@ -80,7 +80,13 @@ module.exports = { success (res) { console.log(n), t.showSuccess("支付成功!", e); }, - fail (res) { + fail (n) { + if(!n.errMsg ) { + getApp().showWarning("支付失败"); + "function" == typeof fail && fail(); + return false; + } + console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") : t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), "function" == typeof a && a(); -- libgit2 0.21.4