From e1de2d061edcabd0cd6730015f8ba8bc42f804a4 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 25 Aug 2021 10:59:38 +0800 Subject: [PATCH] 支付提交 --- utils/pay.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/utils/pay.js b/utils/pay.js index c78040c..8cb70d5 100644 --- a/utils/pay.js +++ b/utils/pay.js @@ -53,6 +53,7 @@ module.exports = { }, weixinPay: function(n, e, a) { if(!n) return false; + /*-- wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, @@ -67,6 +68,26 @@ module.exports = { t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), "function" == typeof a && a(); } - }); + });--*/ + + wx.requestOrderPayment({ + timeStamp: String(n.timeStamp), + nonceStr: n.nonceStr, + package: n.packageValue, + signType: n.signType, + paySign: n.paySign, + orderInfo: n.orderInfo, // 需要新增的 订单 信息 + success (res) { + console.log(n), t.showSuccess("支付成功!", e); + }, + fail (res) { + 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(); + } + }) + + + } }; \ No newline at end of file -- libgit2 0.21.4