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
packageA/pages/chongzhiDetails/chongzhiDetails.js
pages/cart/cart_wk/cart_wk.js
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
pages/user/index/index.js
pages/user/integral/integral.js
utils/pay.js