Commit 0be891dc2f0563e8d178228ba1506009cfdc6252
1 parent
ba1dd705
Cannot read property 'timeStamp' of nul 的提示优化
Showing
10 changed files
with
21 additions
and
5 deletions
packageA/pages/cart2_ser/cart2_ser.js
| @@ -296,6 +296,7 @@ Page({ | @@ -296,6 +296,7 @@ Page({ | ||
| 296 | 296 | ||
| 297 | //------调起支付框-------- | 297 | //------调起支付框-------- |
| 298 | weixinPay: function (n, success, fail) { | 298 | weixinPay: function (n, success, fail) { |
| 299 | + if(!n) return false; | ||
| 299 | wx.requestPayment({ | 300 | wx.requestPayment({ |
| 300 | timeStamp: String(n.timeStamp), | 301 | timeStamp: String(n.timeStamp), |
| 301 | nonceStr: n.nonceStr, | 302 | nonceStr: n.nonceStr, |
packageA/pages/chongzhiDetails/chongzhiDetails.js
| @@ -217,6 +217,7 @@ Page({ | @@ -217,6 +217,7 @@ Page({ | ||
| 217 | 217 | ||
| 218 | //------调起支付框-------- | 218 | //------调起支付框-------- |
| 219 | weixinPay: function (n, success, fail) { | 219 | weixinPay: function (n, success, fail) { |
| 220 | + if(!n) return false; | ||
| 220 | wx.requestPayment({ | 221 | wx.requestPayment({ |
| 221 | timeStamp: String(n.timeStamp), | 222 | timeStamp: String(n.timeStamp), |
| 222 | nonceStr: n.nonceStr, | 223 | nonceStr: n.nonceStr, |
pages/cart/cart_wk/cart_wk.js
| @@ -551,6 +551,7 @@ Page({ | @@ -551,6 +551,7 @@ Page({ | ||
| 551 | 551 | ||
| 552 | //------调起支付框-------- | 552 | //------调起支付框-------- |
| 553 | weixinPay: function(n, success,fail) { | 553 | weixinPay: function(n, success,fail) { |
| 554 | + if(!n) return false; | ||
| 554 | var th=this; | 555 | var th=this; |
| 555 | wx.requestPayment({ | 556 | wx.requestPayment({ |
| 556 | timeStamp: String(n.timeStamp), | 557 | timeStamp: String(n.timeStamp), |
pages/giftpack/buygiftpack/giftpackbuy.js
| @@ -104,9 +104,12 @@ Page({ | @@ -104,9 +104,12 @@ Page({ | ||
| 104 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 104 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 105 | getApp().request.json_post(url, json, | 105 | getApp().request.json_post(url, json, |
| 106 | function(res) { | 106 | function(res) { |
| 107 | - if (res.data.code == 0) { | ||
| 108 | - var order_sn = res.data.data.orderSn; | ||
| 109 | - res = res.data.data.result; | 107 | + if (res.data.code == 0 && res.data.data) { |
| 108 | + | ||
| 109 | + var order_sn = res.data.data.orderSn; | ||
| 110 | + res = res.data.data.result; | ||
| 111 | + if(!res) return false; | ||
| 112 | + | ||
| 110 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | 113 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; |
| 111 | wx.requestPayment({ | 114 | wx.requestPayment({ |
| 112 | timeStamp: String(res.timeStamp), | 115 | timeStamp: String(res.timeStamp), |
| @@ -118,7 +121,7 @@ Page({ | @@ -118,7 +121,7 @@ Page({ | ||
| 118 | getApp().goto(url); | 121 | getApp().goto(url); |
| 119 | }, | 122 | }, |
| 120 | fail: function(res) { | 123 | fail: function(res) { |
| 121 | - getApp().my_confirm("取消支付", 0, th); | 124 | + getApp().my_warnning("取消支付", 0, th); |
| 122 | } | 125 | } |
| 123 | }); | 126 | }); |
| 124 | } else { | 127 | } else { |
pages/giftpack/giftpacklist/giftpacklist.js
| @@ -113,6 +113,9 @@ Page({ | @@ -113,6 +113,9 @@ Page({ | ||
| 113 | function(res) { | 113 | function(res) { |
| 114 | if (res.data.code == 0) { | 114 | if (res.data.code == 0) { |
| 115 | var res = res.data.data; | 115 | var res = res.data.data; |
| 116 | + if(!res) return false; | ||
| 117 | + if(!res.result) return false; | ||
| 118 | + | ||
| 116 | var order_sn = res.orderSn; | 119 | var order_sn = res.orderSn; |
| 117 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | 120 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; |
| 118 | wx.requestPayment({ | 121 | wx.requestPayment({ |
pages/user/deposit/prepaid/prepaid.js
| @@ -159,6 +159,8 @@ Page({ | @@ -159,6 +159,8 @@ Page({ | ||
| 159 | 159 | ||
| 160 | //------调起支付框-------- | 160 | //------调起支付框-------- |
| 161 | weixinPay: function (n, success, fail) { | 161 | weixinPay: function (n, success, fail) { |
| 162 | + if(!n) return false; | ||
| 163 | + | ||
| 162 | wx.requestPayment({ | 164 | wx.requestPayment({ |
| 163 | timeStamp: String(n.timeStamp), | 165 | timeStamp: String(n.timeStamp), |
| 164 | nonceStr: n.nonceStr, | 166 | nonceStr: n.nonceStr, |
pages/user/index/index.js
| @@ -733,7 +733,9 @@ Page({ | @@ -733,7 +733,9 @@ Page({ | ||
| 733 | 733 | ||
| 734 | //添加卡包 | 734 | //添加卡包 |
| 735 | addcard:function(){ | 735 | addcard:function(){ |
| 736 | - var res=this.data.add_card_data; | 736 | + var res=this.data.add_card_data; |
| 737 | + if(!res) return false; | ||
| 738 | + | ||
| 737 | var arr = new Array(6) | 739 | var arr = new Array(6) |
| 738 | arr[0] = res.code; | 740 | arr[0] = res.code; |
| 739 | arr[1] = res.timestamp; | 741 | arr[1] = res.timestamp; |
pages/user/integral/integral.js
| @@ -283,6 +283,7 @@ Page({ | @@ -283,6 +283,7 @@ Page({ | ||
| 283 | 283 | ||
| 284 | //------调起支付框-------- | 284 | //------调起支付框-------- |
| 285 | weixinPay: function (n, success, fail) { | 285 | weixinPay: function (n, success, fail) { |
| 286 | + if(!n) return false; | ||
| 286 | wx.requestPayment({ | 287 | wx.requestPayment({ |
| 287 | timeStamp: String(n.timeStamp), | 288 | timeStamp: String(n.timeStamp), |
| 288 | nonceStr: n.nonceStr, | 289 | nonceStr: n.nonceStr, |
utils/pay.js
| @@ -52,6 +52,7 @@ module.exports = { | @@ -52,6 +52,7 @@ module.exports = { | ||
| 52 | }); | 52 | }); |
| 53 | }, | 53 | }, |
| 54 | weixinPay: function(n, e, a) { | 54 | weixinPay: function(n, e, a) { |
| 55 | + if(!n) return false; | ||
| 55 | wx.requestPayment({ | 56 | wx.requestPayment({ |
| 56 | timeStamp: String(n.timeStamp), | 57 | timeStamp: String(n.timeStamp), |
| 57 | nonceStr: n.nonceStr, | 58 | nonceStr: n.nonceStr, |
utils/pay2.js
| @@ -27,6 +27,7 @@ module.exports = { | @@ -27,6 +27,7 @@ module.exports = { | ||
| 27 | }); | 27 | }); |
| 28 | }, | 28 | }, |
| 29 | weixinPay: function(n, succ,fail) { | 29 | weixinPay: function(n, succ,fail) { |
| 30 | + if(!n) return false; | ||
| 30 | wx.requestPayment({ | 31 | wx.requestPayment({ |
| 31 | timeStamp: String(n.timeStamp), | 32 | timeStamp: String(n.timeStamp), |
| 32 | nonceStr: n.nonceStr, | 33 | nonceStr: n.nonceStr, |