diff --git a/packageA/pages/cart2_ser/cart2_ser.js b/packageA/pages/cart2_ser/cart2_ser.js index fc0f10c..fb3c9e9 100644 --- a/packageA/pages/cart2_ser/cart2_ser.js +++ b/packageA/pages/cart2_ser/cart2_ser.js @@ -296,6 +296,7 @@ Page({ //------调起支付框-------- weixinPay: function (n, success, fail) { + if(!n) return false; wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.js b/packageA/pages/chongzhiDetails/chongzhiDetails.js index f2608dd..34c2704 100644 --- a/packageA/pages/chongzhiDetails/chongzhiDetails.js +++ b/packageA/pages/chongzhiDetails/chongzhiDetails.js @@ -217,6 +217,7 @@ Page({ //------调起支付框-------- weixinPay: function (n, success, fail) { + if(!n) return false; wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 2efd939..2924b15 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -551,6 +551,7 @@ Page({ //------调起支付框-------- weixinPay: function(n, success,fail) { + if(!n) return false; var th=this; wx.requestPayment({ timeStamp: String(n.timeStamp), diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index 062f03f..adcd413 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -104,9 +104,12 @@ Page({ var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; getApp().request.json_post(url, json, function(res) { - if (res.data.code == 0) { - var order_sn = res.data.data.orderSn; - res = res.data.data.result; + if (res.data.code == 0 && res.data.data) { + + var order_sn = res.data.data.orderSn; + res = res.data.data.result; + if(!res) return false; + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; wx.requestPayment({ timeStamp: String(res.timeStamp), @@ -118,7 +121,7 @@ Page({ getApp().goto(url); }, fail: function(res) { - getApp().my_confirm("取消支付", 0, th); + getApp().my_warnning("取消支付", 0, th); } }); } else { diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index eebada5..9438489 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -113,6 +113,9 @@ Page({ function(res) { if (res.data.code == 0) { var res = res.data.data; + if(!res) return false; + if(!res.result) return false; + var order_sn = res.orderSn; var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; wx.requestPayment({ diff --git a/pages/user/deposit/prepaid/prepaid.js b/pages/user/deposit/prepaid/prepaid.js index bccda79..a70b9a1 100644 --- a/pages/user/deposit/prepaid/prepaid.js +++ b/pages/user/deposit/prepaid/prepaid.js @@ -159,6 +159,8 @@ Page({ //------调起支付框-------- weixinPay: function (n, success, fail) { + if(!n) return false; + wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, diff --git a/pages/user/index/index.js b/pages/user/index/index.js index c788031..96e2a61 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -733,7 +733,9 @@ Page({ //添加卡包 addcard:function(){ - var res=this.data.add_card_data; + var res=this.data.add_card_data; + if(!res) return false; + var arr = new Array(6) arr[0] = res.code; arr[1] = res.timestamp; diff --git a/pages/user/integral/integral.js b/pages/user/integral/integral.js index 745379b..ab3d4f2 100644 --- a/pages/user/integral/integral.js +++ b/pages/user/integral/integral.js @@ -283,6 +283,7 @@ Page({ //------调起支付框-------- weixinPay: function (n, success, fail) { + if(!n) return false; wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, diff --git a/utils/pay.js b/utils/pay.js index 82b18ab..c78040c 100644 --- a/utils/pay.js +++ b/utils/pay.js @@ -52,6 +52,7 @@ module.exports = { }); }, weixinPay: function(n, e, a) { + if(!n) return false; wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, diff --git a/utils/pay2.js b/utils/pay2.js index 084a4a2..3e46819 100644 --- a/utils/pay2.js +++ b/utils/pay2.js @@ -27,6 +27,7 @@ module.exports = { }); }, weixinPay: function(n, succ,fail) { + if(!n) return false; wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr,