Commit b0a3fa4411940ef1a0f7a2c4556ba97341e38b76
1 parent
922e3172
支付优化
Showing
1 changed file
with
7 additions
and
13 deletions
utils/pay.js
| ... | ... | @@ -80,27 +80,21 @@ module.exports = { |
| 80 | 80 | }) |
| 81 | 81 | |
| 82 | 82 | }else{ |
| 83 | - wx.requestOrderPayment({ | |
| 83 | + wx.requestPayment({ | |
| 84 | 84 | timeStamp: String(n.timeStamp), |
| 85 | 85 | nonceStr: n.nonceStr, |
| 86 | 86 | package: n.packageValue, |
| 87 | 87 | signType: n.signType, |
| 88 | 88 | paySign: n.paySign, |
| 89 | - success (n) { | |
| 90 | - t.showSuccess("支付成功!", e); | |
| 89 | + success: function (n) { | |
| 90 | + console.log(n), t.showSuccess("支付成功!", e); | |
| 91 | 91 | }, |
| 92 | - fail (n) { | |
| 93 | - if(!n.errMsg ) { | |
| 94 | - getApp().showWarning("支付失败"); | |
| 95 | - "function" == typeof fail && fail(); | |
| 96 | - return false; | |
| 97 | - } | |
| 98 | - | |
| 99 | - console.log(n), "requestOrderPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestOrderPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") : | |
| 100 | - t.confirmBox("支付失败:" + n.errMsg.substr("requestOrderPayment:fail ".length)), | |
| 92 | + fail: function (n) { | |
| 93 | + console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") : | |
| 94 | + t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), | |
| 101 | 95 | "function" == typeof a && a(); |
| 102 | 96 | } |
| 103 | - }) | |
| 97 | + }); | |
| 104 | 98 | } |
| 105 | 99 | |
| 106 | 100 | ... | ... |