Commit 61793b4aecfadd939daafa18b8f9c78b308795b6

Authored by yvan.ni
1 parent 222ab3dd

可售不可售的显示顺序的优化

pages/goods/goodsInfo/goodsInfo.js
... ... @@ -273,6 +273,7 @@ Page({
273 273 cx_prom_group: [], //促销活动,用于显示和判断默认要用什么促销活动
274 274 showFold:true,
275 275 new_share_imgurl:'', //普通商品分享图片
  276 +
276 277 },
277 278  
278 279 //------初始化加载----------
... ... @@ -846,28 +847,29 @@ Page({
846 847 });
847 848  
848 849 var ee = JSON.parse(JSON.stringify(e));
849   - //--定时器推迟一下--
850   - setTimeout(function () {
851   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
852   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
853   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
854   - ee.is_no_dis = 1;
855   - }
856 850  
857   - //-- 如果有指定门店的时候,pickup_ids是经过判断是不是普通商品后才会有的 --
858   - if(th.data.sele_g && th.data.sele_g.pickup_ids){
  851 + //--定时器推迟一下--
  852 + var appd = getApp().globalData;
  853 + var w_time = setInterval(function () {
  854 + if (that.data.is_get_local_ok == 0) return false;
  855 + if (!that.data.sele_g) return false;
  856 +
  857 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  858 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  859 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  860 + ee.is_no_dis = 1;
  861 + }
  862 +
  863 + //-- 如果有指定门店的时候,pickup_ids是经过判断是不是普通商品后才会有的 --
  864 + if(th.data.sele_g && th.data.sele_g.pickup_ids && th.data.prom_type==0){
859 865 var idx=th.data.sele_g.pickup_ids.findIndex(function (e){
860   - return e.pickup_id==ee.pickup_id;
  866 + return e.pickup_id==ee.pickup_id;
861 867 })
862 868 if(idx<0){
863   - ee.is_no_dis=1;
  869 + ee.is_no_dis_nor=1;
864 870 }
865   - }
866   -
  871 + }
867 872  
868   - var appd = getApp().globalData;
869   - var w_time = setInterval(function () {
870   - if (that.data.is_get_local_ok == 0) return false;
871 873 clearInterval(w_time);
872 874 var distance = null;
873 875 var e = JSON.parse(JSON.stringify(ee));
... ... @@ -910,8 +912,8 @@ Page({
910 912 that.set_def_storage(e);
911 913 }
912 914 }
913   - }, 500)
914   - }, 700)
  915 + }, 200)
  916 +
915 917 });
916 918 },
917 919  
... ... @@ -3519,6 +3521,8 @@ Page({
3519 3521  
3520 3522 var timer_get = setInterval(function () {
3521 3523 if (th.data.is_get_local_ok == 0) return false;
  3524 + if (!th.data.fir_def_store) return false;
  3525 +
3522 3526 var dd = null,
3523 3527 i = getApp().request;
3524 3528 if (!th.data.sele_g) return false;
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -1325,7 +1325,7 @@
1325 1325 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
1326 1326 <block wx:else>
1327 1327 <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
1328   - <view class="no_store" wx:if="{{def_pick_store.is_no_dis_nor}}">(该店不可售)</view>
  1328 + <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_nor}}">(该店不可售)</view>
1329 1329 <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0 &&!sele_g.whsle_id }}">
1330 1330 (库存不足)
1331 1331 </view>
... ... @@ -1668,9 +1668,9 @@
1668 1668 <view class="flex-vertical-between ">
1669 1669 <view class="flex xc-ash">
1670 1670 <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
1671   - <text class="c-red22" wx:if="{{item.is_no_qyt }}">(库存不足)</text>
1672 1671 <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
1673   - <text class="c-red22" wx:if="{{item.is_no_dis_nor}}">(该店不可售)</text>
  1672 + <text class="c-red22" wx:elif="{{item.is_no_dis_nor}}">(该店不可售)</text>
  1673 + <text class="c-red22" wx:elif="{{item.is_no_qyt }}">(库存不足)</text>
1674 1674 </view>
1675 1675 </view>
1676 1676 <view>
... ...