Commit 72550b3981417c60a8fab3781bd0ca132d7bfcf5

Authored by yvan.ni
1 parent 2510bf00

普通商品提交订单,拼单商品提交订单

pages/cart/cart2/cart2.js
... ... @@ -1461,6 +1461,7 @@ Page({
1461 1461 data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code},
1462 1462 success:function(rse){
1463 1463 if (rse.data.code==0){
  1464 + getApp().globalData.userInfo.def_exp_code=is_shipping_code;
1464 1465 th.setData({ open_express: 0 });
1465 1466 //----计算此时购物车的价格----
1466 1467 if(th.data.is_b_now==1) th.calculatePrice2();
... ... @@ -1475,8 +1476,9 @@ Page({
1475 1476 var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
1476 1477 //--定时器,判断wu_arr不未空--
1477 1478 var uii=setInterval(function () {
1478   - if(th.data.wu_arr) clearInterval(uii);
1479   - else {
  1479 + if(th.data.wu_arr)
  1480 + {
  1481 + clearInterval(uii);
1480 1482 for (var k = 0; k < th.data.wu_arr.length; k++) {
1481 1483 var item = th.data.wu_arr[k];
1482 1484 if (def_exp_code == item.code) { m_wind = k; }
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -677,8 +677,8 @@ Page({
677 677 var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
678 678  
679 679 var uii=setInterval(function () {
680   - if(th.data.wu_arr) clearInterval(uii);
681   - else {
  680 + if(th.data.wu_arr){
  681 + clearInterval(uii);
682 682 for (var k = 0; k < th.data.wu_arr.length; k++) {
683 683 var item = th.data.wu_arr[k];
684 684 if (def_exp_code == item.code) {
... ... @@ -708,5 +708,22 @@ Page({
708 708 this.setData({ open_express: 0});
709 709 this.calculatePrice2();
710 710 },
  711 + //设置默认物流
  712 + select_default_logistics: function () {
  713 + var th=this;
  714 + var is_shipping_code=this.data.is_shipping_code
  715 + getApp().request.put("/api/weshop/users/update",{
  716 + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code},
  717 + success:function(rse){
  718 + if (rse.data.code==0){
  719 + getApp().globalData.userInfo.def_exp_code=is_shipping_code;
  720 + th.setData({ open_express: 0 });
  721 + //----计算此时购物车的价格----
  722 + if(th.data.is_b_now==1) th.calculatePrice2();
  723 + else th.calculatePrice();
  724 + }
  725 + }
  726 + })
  727 + },
711 728  
712 729 });
... ...