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();