Commit e1de2d061edcabd0cd6730015f8ba8bc42f804a4
1 parent
4fc8f1f1
支付提交
Showing
1 changed file
with
22 additions
and
1 deletions
utils/pay.js
| @@ -53,6 +53,7 @@ module.exports = { | @@ -53,6 +53,7 @@ module.exports = { | ||
| 53 | }, | 53 | }, | 
| 54 | weixinPay: function(n, e, a) { | 54 | weixinPay: function(n, e, a) { | 
| 55 | if(!n) return false; | 55 | if(!n) return false; | 
| 56 | + /*-- | ||
| 56 | wx.requestPayment({ | 57 | wx.requestPayment({ | 
| 57 | timeStamp: String(n.timeStamp), | 58 | timeStamp: String(n.timeStamp), | 
| 58 | nonceStr: n.nonceStr, | 59 | nonceStr: n.nonceStr, | 
| @@ -67,6 +68,26 @@ module.exports = { | @@ -67,6 +68,26 @@ module.exports = { | ||
| 67 | t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), | 68 | t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), | 
| 68 | "function" == typeof a && a(); | 69 | "function" == typeof a && a(); | 
| 69 | } | 70 | } | 
| 70 | - }); | 71 | + });--*/ | 
| 72 | + | ||
| 73 | + wx.requestOrderPayment({ | ||
| 74 | + timeStamp: String(n.timeStamp), | ||
| 75 | + nonceStr: n.nonceStr, | ||
| 76 | + package: n.packageValue, | ||
| 77 | + signType: n.signType, | ||
| 78 | + paySign: n.paySign, | ||
| 79 | + orderInfo: n.orderInfo, // 需要新增的 订单 信息 | ||
| 80 | + success (res) { | ||
| 81 | + console.log(n), t.showSuccess("支付成功!", e); | ||
| 82 | + }, | ||
| 83 | + fail (res) { | ||
| 84 | + console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") : | ||
| 85 | + t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), | ||
| 86 | + "function" == typeof a && a(); | ||
| 87 | + } | ||
| 88 | + }) | ||
| 89 | + | ||
| 90 | + | ||
| 91 | + | ||
| 71 | } | 92 | } | 
| 72 | }; | 93 | }; | 
| 73 | \ No newline at end of file | 94 | \ No newline at end of file |