diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 496e010..897329b 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1461,6 +1461,7 @@ Page({ data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, success:function(rse){ if (rse.data.code==0){ + getApp().globalData.userInfo.def_exp_code=is_shipping_code; th.setData({ open_express: 0 }); //----计算此时购物车的价格---- if(th.data.is_b_now==1) th.calculatePrice2(); @@ -1475,8 +1476,9 @@ Page({ var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; //--定时器,判断wu_arr不未空-- var uii=setInterval(function () { - if(th.data.wu_arr) clearInterval(uii); - else { + if(th.data.wu_arr) + { + clearInterval(uii); for (var k = 0; k < th.data.wu_arr.length; k++) { var item = th.data.wu_arr[k]; if (def_exp_code == item.code) { m_wind = k; } diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 2f4ae74..f30cfcf 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -677,8 +677,8 @@ Page({ var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; var uii=setInterval(function () { - if(th.data.wu_arr) clearInterval(uii); - else { + if(th.data.wu_arr){ + clearInterval(uii); for (var k = 0; k < th.data.wu_arr.length; k++) { var item = th.data.wu_arr[k]; if (def_exp_code == item.code) { @@ -708,5 +708,22 @@ Page({ this.setData({ open_express: 0}); this.calculatePrice2(); }, + //设置默认物流 + select_default_logistics: function () { + var th=this; + var is_shipping_code=this.data.is_shipping_code + getApp().request.put("/api/weshop/users/update",{ + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, + success:function(rse){ + if (rse.data.code==0){ + getApp().globalData.userInfo.def_exp_code=is_shipping_code; + th.setData({ open_express: 0 }); + //----计算此时购物车的价格---- + if(th.data.is_b_now==1) th.calculatePrice2(); + else th.calculatePrice(); + } + } + }) + }, });