Commit 01ce1321f2243d83ef6b7562bcba8730a66f6708

Authored by yvan.ni
1 parent 718cd45d

积分购的同城配送的优化

pages/cart/cart2_inte/cart2_inte.js
... ... @@ -167,7 +167,7 @@ Page({
167 167 //th.data.prom_goods_map={};
168 168 //更换地址回来要重新调用计算价钱的接口
169 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 171 if (th.data.is_b_now == 1) {
172 172 if (th.data.bn_goods) {
173 173 th.setData({ add_back: 1 });
... ... @@ -655,6 +655,7 @@ Page({
655 655 //--------------------提交订单-----------------------
656 656 async submitForm(t) {
657 657 var sub_value = t;
  658 + this.setData({submit:1})
658 659  
659 660 if (this.data.is_summit_ing == 1) return false; //--提交中退出--
660 661 this.data.is_summit_ing = 1;
... ... @@ -808,16 +809,13 @@ Page({
808 809 'content-type': 'application/json'
809 810 },// 设置请求的 header
810 811 success: function (res) {
811   -
812   - th.data.is_summit_ing = 0; //是否提交中
813 812 wx.hideLoading();
814 813 if (res.statusCode == 200) {
815 814 var data = res.data;
816 815 if (data.code == 0) {
817   - console.log(th.data.is_b_now);
  816 +
818 817 //如果是购物车结算,还要删除购物车
819 818 if (th.data.is_b_now == 0) {
820   - console.log(th.data.cartlist_y);
821 819 var list = th.data.cartlist_y;
822 820 for (var i = 0; i < list.length; i++) {
823 821 //删除购物车
... ... @@ -889,7 +887,8 @@ Page({
889 887 showCancel: true,
890 888 success(res) {
891 889 if (res.cancel) {
892   - return;
  890 + th.setData({submit:0})
  891 + return;
893 892 } else if (res.confirm) {
894 893 th.data.is_continue = 1;
895 894 th.submitForm(sub_value);
... ... @@ -901,13 +900,17 @@ Page({
901 900 if (msg.length > 13) {
902 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 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 912 fail: function () {
  913 + th.setData({submit:0})
911 914 th.data.is_summit_ing = 0;
912 915 wx.hideLoading();
913 916 console.log("index.js wx.request CheckCallUser fail");
... ...