Commit 0be891dc2f0563e8d178228ba1506009cfdc6252

Authored by yvan.ni
1 parent ba1dd705

Cannot read property 'timeStamp' of nul 的提示优化

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