Commit 01ce1321f2243d83ef6b7562bcba8730a66f6708
1 parent
718cd45d
积分购的同城配送的优化
Showing
1 changed file
with
11 additions
and
8 deletions
pages/cart/cart2_inte/cart2_inte.js
@@ -167,7 +167,7 @@ Page({ | @@ -167,7 +167,7 @@ Page({ | ||
167 | //th.data.prom_goods_map={}; | 167 | //th.data.prom_goods_map={}; |
168 | //更换地址回来要重新调用计算价钱的接口 | 168 | //更换地址回来要重新调用计算价钱的接口 |
169 | if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { | 169 | if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { |
170 | - th.setData({ user_addr: ie, show_submit: 0 }); | 170 | + th.setData({ user_addr: ie }); |
171 | if (th.data.is_b_now == 1) { | 171 | if (th.data.is_b_now == 1) { |
172 | if (th.data.bn_goods) { | 172 | if (th.data.bn_goods) { |
173 | th.setData({ add_back: 1 }); | 173 | th.setData({ add_back: 1 }); |
@@ -655,6 +655,7 @@ Page({ | @@ -655,6 +655,7 @@ Page({ | ||
655 | //--------------------提交订单----------------------- | 655 | //--------------------提交订单----------------------- |
656 | async submitForm(t) { | 656 | async submitForm(t) { |
657 | var sub_value = t; | 657 | var sub_value = t; |
658 | + this.setData({submit:1}) | ||
658 | 659 | ||
659 | if (this.data.is_summit_ing == 1) return false; //--提交中退出-- | 660 | if (this.data.is_summit_ing == 1) return false; //--提交中退出-- |
660 | this.data.is_summit_ing = 1; | 661 | this.data.is_summit_ing = 1; |
@@ -808,16 +809,13 @@ Page({ | @@ -808,16 +809,13 @@ Page({ | ||
808 | 'content-type': 'application/json' | 809 | 'content-type': 'application/json' |
809 | },// 设置请求的 header | 810 | },// 设置请求的 header |
810 | success: function (res) { | 811 | success: function (res) { |
811 | - | ||
812 | - th.data.is_summit_ing = 0; //是否提交中 | ||
813 | wx.hideLoading(); | 812 | wx.hideLoading(); |
814 | if (res.statusCode == 200) { | 813 | if (res.statusCode == 200) { |
815 | var data = res.data; | 814 | var data = res.data; |
816 | if (data.code == 0) { | 815 | if (data.code == 0) { |
817 | - console.log(th.data.is_b_now); | 816 | + |
818 | //如果是购物车结算,还要删除购物车 | 817 | //如果是购物车结算,还要删除购物车 |
819 | if (th.data.is_b_now == 0) { | 818 | if (th.data.is_b_now == 0) { |
820 | - console.log(th.data.cartlist_y); | ||
821 | var list = th.data.cartlist_y; | 819 | var list = th.data.cartlist_y; |
822 | for (var i = 0; i < list.length; i++) { | 820 | for (var i = 0; i < list.length; i++) { |
823 | //删除购物车 | 821 | //删除购物车 |
@@ -889,7 +887,8 @@ Page({ | @@ -889,7 +887,8 @@ Page({ | ||
889 | showCancel: true, | 887 | showCancel: true, |
890 | success(res) { | 888 | success(res) { |
891 | if (res.cancel) { | 889 | if (res.cancel) { |
892 | - return; | 890 | + th.setData({submit:0}) |
891 | + return; | ||
893 | } else if (res.confirm) { | 892 | } else if (res.confirm) { |
894 | th.data.is_continue = 1; | 893 | th.data.is_continue = 1; |
895 | th.submitForm(sub_value); | 894 | th.submitForm(sub_value); |
@@ -901,13 +900,17 @@ Page({ | @@ -901,13 +900,17 @@ Page({ | ||
901 | if (msg.length > 13) { | 900 | if (msg.length > 13) { |
902 | msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); | 901 | msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); |
903 | } | 902 | } |
904 | - getApp().confirmBox(msg); | 903 | + getApp().confirmBox(msg); |
904 | + th.data.is_summit_ing = 0; //是否提交中 | ||
905 | } | 905 | } |
906 | } else { | 906 | } else { |
907 | - console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | 907 | + th.setData({submit:0}) |
908 | + th.data.is_summit_ing = 0; //是否提交中 | ||
909 | + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | ||
908 | } | 910 | } |
909 | }, | 911 | }, |
910 | fail: function () { | 912 | fail: function () { |
913 | + th.setData({submit:0}) | ||
911 | th.data.is_summit_ing = 0; | 914 | th.data.is_summit_ing = 0; |
912 | wx.hideLoading(); | 915 | wx.hideLoading(); |
913 | console.log("index.js wx.request CheckCallUser fail"); | 916 | console.log("index.js wx.request CheckCallUser fail"); |