Commit ec746ef7acafe3b43d9231259e2dcba3d08d3afa
1 parent
d01195f1
虚拟商品的优化
Showing
9 changed files
with
54 additions
and
31 deletions
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
| ... | ... | @@ -3218,7 +3218,7 @@ Page({ |
| 3218 | 3218 | |
| 3219 | 3219 | //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- |
| 3220 | 3220 | if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && |
| 3221 | - th.data.sales_rules >= 2 && !th.data.is_newsales_rules && ([1,2,4,6,8,9].indexOf(th.data.prom_type)== -1 || is_normal == 1) { | |
| 3221 | + th.data.sales_rules >= 2 && !th.data.is_newsales_rules && ([1,2,4,6,8,9].indexOf(th.data.prom_type)== -1 || is_normal == 1)) { | |
| 3222 | 3222 | setTimeout(function () { |
| 3223 | 3223 | th.deal_pickup_dline(e); |
| 3224 | 3224 | }, 800) | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
| ... | ... | @@ -436,7 +436,8 @@ |
| 436 | 436 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
| 437 | 437 | (配送不匹配) |
| 438 | 438 | </view> |
| 439 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}"> | |
| 439 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty | |
| 440 | + && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
| 440 | 441 | (库存不足) |
| 441 | 442 | </view> |
| 442 | 443 | </block> |
| ... | ... | @@ -1064,12 +1065,17 @@ |
| 1064 | 1065 | <block wx:if="{{prom_type == 0}}"> |
| 1065 | 1066 | <view class="flex"> |
| 1066 | 1067 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
| 1068 | + <!-- 线下门店销售的时候 --> | |
| 1067 | 1069 | <block wx:if="{{sales_rules>=2}}"> |
| 1068 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
| 1069 | - 可售:{{def_pick_store.CanOutQty}} | |
| 1070 | - </view> | |
| 1071 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
| 1070 | + | |
| 1071 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
| 1072 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
| 1073 | + 可售:{{def_pick_store.CanOutQty}} | |
| 1074 | + </view> | |
| 1075 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
| 1076 | + </block> | |
| 1072 | 1077 | </block> |
| 1078 | + | |
| 1073 | 1079 | <block wx:else> |
| 1074 | 1080 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
| 1075 | 1081 | </block> |
| ... | ... | @@ -1105,7 +1111,7 @@ |
| 1105 | 1111 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 1106 | 1112 | <block wx:else> |
| 1107 | 1113 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 1108 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}"> | |
| 1114 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
| 1109 | 1115 | (库存不足) |
| 1110 | 1116 | </view> |
| 1111 | 1117 | </block> |
| ... | ... | @@ -1177,7 +1183,7 @@ |
| 1177 | 1183 | </block> |
| 1178 | 1184 | <block wx:else> |
| 1179 | 1185 | <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> |
| 1180 | - <block wx:if="{{sales_rules>=2 && prom_type==0}}"> | |
| 1186 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
| 1181 | 1187 | <block wx:if="{{!def_pick_store.CanOutQty}}"> |
| 1182 | 1188 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
| 1183 | 1189 | 库存不足 | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -194,7 +194,8 @@ |
| 194 | 194 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
| 195 | 195 | (配送不匹配2) |
| 196 | 196 | </view> |
| 197 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
| 197 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty | |
| 198 | + && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
| 198 | 199 | (库存不足) |
| 199 | 200 | </view> |
| 200 | 201 | </block> |
| ... | ... | @@ -630,7 +631,8 @@ |
| 630 | 631 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 631 | 632 | <block wx:else> |
| 632 | 633 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配1)</view> |
| 633 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
| 634 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty | |
| 635 | + && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
| 634 | 636 | (库存不足) |
| 635 | 637 | </view> |
| 636 | 638 | </block> | ... | ... |
pages/goods/goodsInfo/buy_com_pop.wxml
| ... | ... | @@ -13,10 +13,14 @@ |
| 13 | 13 | <view class="flex"> |
| 14 | 14 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
| 15 | 15 | <block wx:if="{{sales_rules>=2}}"> |
| 16 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
| 17 | - 可售:{{def_pick_store.CanOutQty}} | |
| 18 | - </view> | |
| 19 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
| 16 | + | |
| 17 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
| 18 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
| 19 | + 可售:{{def_pick_store.CanOutQty}} | |
| 20 | + </view> | |
| 21 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
| 22 | + </block> | |
| 23 | + | |
| 20 | 24 | </block> |
| 21 | 25 | <block wx:else> |
| 22 | 26 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
| ... | ... | @@ -53,7 +57,7 @@ |
| 53 | 57 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 54 | 58 | <block wx:else> |
| 55 | 59 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 56 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2}}"> | |
| 60 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && !filters.is_virtual_gd(sele_g.is_virtual) }}"> | |
| 57 | 61 | (库存不足) |
| 58 | 62 | </view> |
| 59 | 63 | </block> |
| ... | ... | @@ -136,7 +140,7 @@ |
| 136 | 140 | </view> |
| 137 | 141 | </block> |
| 138 | 142 | <block wx:else> |
| 139 | - <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id}}"> | |
| 143 | + <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id && !filters.is_virtual_gd(sele_g.is_virtual) }}"> | |
| 140 | 144 | <view wx:if="{{!def_pick_store.CanOutQty}}" class="spec-cart-btn fs32" data-action="add" |
| 141 | 145 | style="background-color: #dcdcdc;color: #999">库存不足 |
| 142 | 146 | </view> | ... | ... |
pages/goods/goodsInfo/buy_integral.wxml
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | |
| 29 | 29 | <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> |
| 30 | 30 | <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> |
| 31 | - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | |
| 31 | + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | |
| 32 | 32 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} |
| 33 | 33 | |
| 34 | 34 | </view> |
| ... | ... | @@ -47,11 +47,11 @@ |
| 47 | 47 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 48 | 48 | <block wx:else> |
| 49 | 49 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 50 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
| 50 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}">(库存不足)</view> | |
| 51 | 51 | </block> |
| 52 | 52 | </block> |
| 53 | 53 | |
| 54 | - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | |
| 54 | + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | <!--商品的属性项目--> | ... | ... |
pages/goods/goodsInfo/buy_pt.wxml
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 72 | 72 | <block wx:else> |
| 73 | 73 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 74 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && is_normal}}">(库存不足)</view> | |
| 74 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && is_normal}}">(库存不足)</view> | |
| 75 | 75 | </block> |
| 76 | 76 | </block> |
| 77 | 77 | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -6897,7 +6897,7 @@ Page({ |
| 6897 | 6897 | var lock = 0; |
| 6898 | 6898 | |
| 6899 | 6899 | //---如果是活动的时候,同时不是普通购买--- |
| 6900 | - if (th.data.sele_g.whsle_id || [1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal) { | |
| 6900 | + if (getApp().is_virtual(th.data.sele_g) || th.data.sele_g.whsle_id || ([1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal)) { | |
| 6901 | 6901 | func(); |
| 6902 | 6902 | return false; |
| 6903 | 6903 | } | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -681,7 +681,7 @@ |
| 681 | 681 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
| 682 | 682 | (配送不匹配) |
| 683 | 683 | </view> |
| 684 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0 && !sele_g.whsle_id}}"> | |
| 684 | + <view class="no_store" 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}}"> | |
| 685 | 685 | (库存不足) |
| 686 | 686 | </view> |
| 687 | 687 | </block> |
| ... | ... | @@ -1261,12 +1261,19 @@ |
| 1261 | 1261 | <block wx:if="{{prom_type==0}}"> |
| 1262 | 1262 | <view class="flex"> |
| 1263 | 1263 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
| 1264 | + <!-- 线下门店销售的时候 --> | |
| 1264 | 1265 | <block wx:if="{{sales_rules>=2}}"> |
| 1265 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
| 1266 | - 可售:{{def_pick_store.CanOutQty}} | |
| 1267 | - </view> | |
| 1268 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
| 1266 | + | |
| 1267 | + <!-- 如果不是虚拟商品的时候 --> | |
| 1268 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
| 1269 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
| 1270 | + 可售:{{def_pick_store.CanOutQty}} | |
| 1271 | + </view> | |
| 1272 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
| 1273 | + </block> | |
| 1274 | + | |
| 1269 | 1275 | </block> |
| 1276 | + | |
| 1270 | 1277 | <block wx:else> |
| 1271 | 1278 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
| 1272 | 1279 | </block> |
| ... | ... | @@ -1311,7 +1318,7 @@ |
| 1311 | 1318 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
| 1312 | 1319 | <block wx:else> |
| 1313 | 1320 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
| 1314 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0 &&!sele_g.whsle_id}}"> | |
| 1321 | + <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 && !filters.is_virtual_gd(sele_g)}}"> | |
| 1315 | 1322 | (库存不足) |
| 1316 | 1323 | </view> |
| 1317 | 1324 | </block> |
| ... | ... | @@ -1391,7 +1398,7 @@ |
| 1391 | 1398 | </block> |
| 1392 | 1399 | <block wx:else> |
| 1393 | 1400 | <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> |
| 1394 | - <block wx:if="{{sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> | |
| 1401 | + <block wx:if="{{sales_rules>=2 && prom_type==0 && !sele_g.whsle_id && !filters.is_virtual_gd(sele_g.is_virtual) }}"> | |
| 1395 | 1402 | <block wx:if="{{!def_pick_store.CanOutQty}}"> |
| 1396 | 1403 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
| 1397 | 1404 | 库存不足 |
| ... | ... | @@ -1607,7 +1614,7 @@ |
| 1607 | 1614 | <view class="flex-vertical-between butttem5"> |
| 1608 | 1615 | <view class="flex xc-ash"> |
| 1609 | 1616 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} |
| 1610 | - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> | |
| 1617 | + <text class="c-red22" wx:if="{{item.is_no_qyt && !filters.is_virtual_gd(sele_g.is_virtual)}}">(库存不足)</text> | |
| 1611 | 1618 | </view> |
| 1612 | 1619 | </view> |
| 1613 | 1620 | <view> |
| ... | ... | @@ -1635,7 +1642,7 @@ |
| 1635 | 1642 | <view class="flex-vertical-between "> |
| 1636 | 1643 | <view class="flex xc-ash"> |
| 1637 | 1644 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} |
| 1638 | - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> | |
| 1645 | + <text class="c-red22" wx:if="{{item.is_no_qyt && !filters.is_virtual_gd(sele_g.is_virtual) }}">(库存不足)</text> | |
| 1639 | 1646 | </view> |
| 1640 | 1647 | </view> |
| 1641 | 1648 | <view> |
| ... | ... | @@ -1665,7 +1672,7 @@ |
| 1665 | 1672 | <view class="flex-vertical-between "> |
| 1666 | 1673 | <view class="flex xc-ash"> |
| 1667 | 1674 | <view class="fs28 xc-black3 address_name">{{item.pickup_name}} |
| 1668 | - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> | |
| 1675 | + <text class="c-red22" wx:if="{{item.is_no_qyt && !filters.is_virtual_gd(sele_g.is_virtual)}}">(库存不足)</text> | |
| 1669 | 1676 | </view> |
| 1670 | 1677 | </view> |
| 1671 | 1678 | <view> | ... | ... |
utils/filter.wxs
| ... | ... | @@ -289,4 +289,8 @@ module.exports = { |
| 289 | 289 | isExpired: filters.isExpired, |
| 290 | 290 | gettimestamp: filters.gettimestamp, |
| 291 | 291 | showStartAndEndDate: filters.showStartAndEndDate, |
| 292 | + is_virtual_gd:function (is_virtual){ | |
| 293 | + if(is_virtual==2) return true; | |
| 294 | + return false; | |
| 295 | + } | |
| 292 | 296 | } |
| 293 | 297 | \ No newline at end of file | ... | ... |