Commit b2b1f8ec84ea60dabf108f8cc97044b3e1bb5265
1 parent
7485cbc3
商品门店选择的问题优化
Showing
4 changed files
with
35 additions
and
16 deletions
app.js
| ... | ... | @@ -530,21 +530,40 @@ App({ |
| 530 | 530 | } |
| 531 | 531 | if (!th.globalData.pk_store) { |
| 532 | 532 | var pick_id = 0; |
| 533 | - //先找一个会员是否有设置默认的地址 | |
| 534 | - if (th.globalData.userInfo.def_pickup_id) { | |
| 535 | - pick_id = th.globalData.userInfo.def_pickup_id | |
| 536 | - } | |
| 537 | - //查找会员的注册的地址 | |
| 538 | - else if (th.globalData.userInfo.pickup_id) { | |
| 533 | + | |
| 534 | + var is_pricing_open_store=0; | |
| 535 | + var is_regstores=0; | |
| 536 | + if (conf.switch_list) { | |
| 537 | + var t_swi = JSON.parse(conf.switch_list); | |
| 539 | 538 | //--购买门店是否默认登记门店-- |
| 540 | - if (conf.switch_list) { | |
| 541 | - var t_swi = JSON.parse(conf.switch_list); | |
| 542 | - if (t_swi.is_regstores) { | |
| 543 | - pick_id = th.globalData.userInfo.pickup_id | |
| 544 | - } | |
| 539 | + is_regstores=t_swi.is_regstores; | |
| 540 | + is_pricing_open_store=t_swi.is_pricing_open_store; | |
| 541 | + } | |
| 542 | + | |
| 543 | + //-- 如果是区域价格提现,现在注册门店是默认 -- | |
| 544 | + if(is_pricing_open_store){ | |
| 545 | + | |
| 546 | + //查找会员的注册的地址 | |
| 547 | + if (th.globalData.userInfo.pickup_id) { | |
| 548 | + pick_id = th.globalData.userInfo.pickup_id | |
| 549 | + } | |
| 550 | + //先找一个会员是否有设置默认的地址 | |
| 551 | + else if (th.globalData.userInfo.def_pickup_id) { | |
| 552 | + pick_id = th.globalData.userInfo.def_pickup_id | |
| 545 | 553 | } |
| 546 | 554 | |
| 555 | + }else{ | |
| 556 | + //先找一个会员是否有设置默认的地址 | |
| 557 | + if (th.globalData.userInfo.def_pickup_id) { | |
| 558 | + pick_id = th.globalData.userInfo.def_pickup_id | |
| 559 | + } | |
| 560 | + //查找会员的注册的地址 | |
| 561 | + else if (th.globalData.userInfo.pickup_id && is_regstores) { | |
| 562 | + pick_id = th.globalData.userInfo.pickup_id | |
| 563 | + } | |
| 547 | 564 | } |
| 565 | + | |
| 566 | + | |
| 548 | 567 | //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- |
| 549 | 568 | if (pick_id == 0) return func(null); |
| 550 | 569 | ... | ... |
pages/giftpack/public/buy_com.wxml
| ... | ... | @@ -186,7 +186,7 @@ |
| 186 | 186 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| 187 | 187 | <view class="fs30" style="color:black;">选择门店</view> |
| 188 | 188 | </view> |
| 189 | - <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view> | |
| 189 | + <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view> | |
| 190 | 190 | </view> |
| 191 | 191 | <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> |
| 192 | 192 | <block wx:else> | ... | ... |
pages/goods/goodsInfo/buy_integral_normal.wxml
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | <!-- 没有门店的时候 --> |
| 40 | 40 | <view class="flex" bindtap="choice_store" wx:else> |
| 41 | 41 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| 42 | - <view class="fs30" style="color:black;">选择门店</view> | |
| 42 | + <view class="fs30" style="color:black;">选择门店</view> | |
| 43 | 43 | </view> |
| 44 | 44 | |
| 45 | 45 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store" >更多门店<text class="right-arrow"></text></view> |
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 50 | 50 | <block wx:else> |
| 51 | 51 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 52 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
| 52 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2}}">(库存不足)</view> | |
| 53 | 53 | </block> |
| 54 | 54 | </block> |
| 55 | 55 | <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> |
| ... | ... | @@ -118,7 +118,7 @@ |
| 118 | 118 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
| 119 | 119 | </block> |
| 120 | 120 | <block wx:else> |
| 121 | - <block wx:if="{{data.store_count<=0}}"> | |
| 121 | + <block wx:if="{{def_pick_store && !def_pick_store.CanOutQty}}"> | |
| 122 | 122 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
| 123 | 123 | </block> |
| 124 | 124 | <block wx:else> | ... | ... |
pages/goods/goodsInfo/buy_pt.wxml
| ... | ... | @@ -66,7 +66,7 @@ |
| 66 | 66 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store" >更多门店<text class="right-arrow"></text></view> |
| 67 | 67 | </view> |
| 68 | 68 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 69 | - <view class="no_store" wx:elif="{{is_normal && def_pick_store && def_pick_store.CanOutQty<=0}}">(库存不足)</view> | |
| 69 | + <view class="no_store" wx:elif="{{is_normal && def_pick_store && (!def_pick_store.CanOutQty || def_pick_store.CanOutQty<=0)}}">(库存不足)</view> | |
| 70 | 70 | <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.pickup_name}}">地址:{{def_pick_store.fulladdress}}</view> |
| 71 | 71 | </view> |
| 72 | 72 | <!----商品的属性项目----> | ... | ... |