diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js index b9ae5a8..07b8ec1 100644 --- a/pages/cart/cart2_inte/cart2_inte.js +++ b/pages/cart/cart2_inte/cart2_inte.js @@ -167,7 +167,7 @@ Page({ //th.data.prom_goods_map={}; //更换地址回来要重新调用计算价钱的接口 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { - th.setData({ user_addr: ie, show_submit: 0 }); + th.setData({ user_addr: ie }); if (th.data.is_b_now == 1) { if (th.data.bn_goods) { th.setData({ add_back: 1 }); @@ -655,6 +655,7 @@ Page({ //--------------------提交订单----------------------- async submitForm(t) { var sub_value = t; + this.setData({submit:1}) if (this.data.is_summit_ing == 1) return false; //--提交中退出-- this.data.is_summit_ing = 1; @@ -808,16 +809,13 @@ Page({ 'content-type': 'application/json' },// 设置请求的 header success: function (res) { - - th.data.is_summit_ing = 0; //是否提交中 wx.hideLoading(); if (res.statusCode == 200) { var data = res.data; if (data.code == 0) { - console.log(th.data.is_b_now); + //如果是购物车结算,还要删除购物车 if (th.data.is_b_now == 0) { - console.log(th.data.cartlist_y); var list = th.data.cartlist_y; for (var i = 0; i < list.length; i++) { //删除购物车 @@ -889,7 +887,8 @@ Page({ showCancel: true, success(res) { if (res.cancel) { - return; + th.setData({submit:0}) + return; } else if (res.confirm) { th.data.is_continue = 1; th.submitForm(sub_value); @@ -901,13 +900,17 @@ Page({ if (msg.length > 13) { msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); } - getApp().confirmBox(msg); + getApp().confirmBox(msg); + th.data.is_summit_ing = 0; //是否提交中 } } else { - console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); + th.setData({submit:0}) + th.data.is_summit_ing = 0; //是否提交中 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); } }, fail: function () { + th.setData({submit:0}) th.data.is_summit_ing = 0; wx.hideLoading(); console.log("index.js wx.request CheckCallUser fail");