Commit d3468888836feb0e9969999e7bdc9536fda5bc27

Authored by yvan.ni
1 parent cce898e3

商品详情页面的优化

pages/cart/cart/cart.js
@@ -756,6 +756,7 @@ Page({ @@ -756,6 +756,7 @@ Page({
756 data: updata1, 756 data: updata1,
757 }) 757 })
758 item.goods_num = cbuy; 758 item.goods_num = cbuy;
  759 + item.prom=prom; //把活动写入cart_list
759 } 760 }
760 761
761 //价格不对,就要更新一下 762 //价格不对,就要更新一下
@@ -3338,6 +3339,11 @@ Page({ @@ -3338,6 +3339,11 @@ Page({
3338 if (res.data.code == 0) gd = res.data.data; 3339 if (res.data.code == 0) gd = res.data.data;
3339 }) 3340 })
3340 3341
  3342 + //判断秒杀的指定门店
  3343 + if(py_type==1){
  3344 + var prom=i_arr[j].prom;
  3345 + }
  3346 +
3341 if ([0, 3, 5, 7, 10].indexOf(py_type) > -1) { 3347 if ([0, 3, 5, 7, 10].indexOf(py_type) > -1) {
3342 //如果是指定门店,就要判断 3348 //如果是指定门店,就要判断
3343 if(gd.pick_group_ids){ 3349 if(gd.pick_group_ids){
@@ -3345,7 +3351,7 @@ Page({ @@ -3345,7 +3351,7 @@ Page({
3345 return e.pickup_id==i_arr[j].pick_id; 3351 return e.pickup_id==i_arr[j].pick_id;
3346 }) 3352 })
3347 if(idx0<0){ 3353 if(idx0<0){
3348 - getApp().confirmBox(i_arr[j].goods_name + "的指定门店不匹配"); 3354 + getApp().confirmBox(i_arr[j].goods_name + "的门店不可售");
3349 wx.hideLoading(); 3355 wx.hideLoading();
3350 return false; 3356 return false;
3351 } 3357 }
pages/goods/goodsInfo/goodsInfo.js
@@ -3600,7 +3600,14 @@ Page({ @@ -3600,7 +3600,14 @@ Page({
3600 }) 3600 })
3601 3601
3602 if(idx1<0){ 3602 if(idx1<0){
3603 - th.data.def_pick_store.is_no_dis_nor=1; 3603 +
  3604 + //如果是秒杀的指定门店,就要设置秒杀的
  3605 + if(!is_normal && th.data.prom_type==1){
  3606 + th.data.def_pick_store.is_no_dis_act=1;
  3607 + }else{
  3608 + th.data.def_pick_store.is_no_dis_nor=1;
  3609 + }
  3610 +
3604 that.setData({ 3611 that.setData({
3605 def_pick_store: th.data.def_pick_store 3612 def_pick_store: th.data.def_pick_store
3606 }) 3613 })
@@ -3608,7 +3615,7 @@ Page({ @@ -3608,7 +3615,7 @@ Page({
3608 } 3615 }
3609 3616
3610 3617
3611 - e.data.data.pageData=ok_arr; //数组重新赋值 3618 + e.data.data.pageData=ok_arr; //数组重新赋值
3612 e.data.data.total=ok_arr.length; //数组的长度 3619 e.data.data.total=ok_arr.length; //数组的长度
3613 } 3620 }
3614 3621
pages/goods/goodsInfo/goodsInfo.wxml
@@ -709,6 +709,13 @@ @@ -709,6 +709,13 @@
709 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> 709 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
710 (配送不匹配) 710 (配送不匹配)
711 </view> 711 </view>
  712 + <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor && prom_type==0}}">
  713 + (该店不可售)
  714 + </view>
  715 + <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}">
  716 + (该店不可售)
  717 + </view>
  718 +
712 <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> 719 <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}">
713 (库存不足) 720 (库存不足)
714 </view> 721 </view>
@@ -1322,6 +1329,8 @@ @@ -1322,6 +1329,8 @@
1322 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> 1329 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
1323 <block wx:else> 1330 <block wx:else>
1324 <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> 1331 <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  1332 + <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_nor && is_normal}}">(该店不可售)</view>
  1333 + <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_act && !is_normal}}">(该店不可售)</view>
1325 <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 }}"> 1334 <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 }}">
1326 (库存不足) 1335 (库存不足)
1327 </view> 1336 </view>
@@ -1378,6 +1387,13 @@ @@ -1378,6 +1387,13 @@
1378 <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> 1387 <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">
1379 配送不匹配 1388 配送不匹配
1380 </view> 1389 </view>
  1390 + <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor && is_normal}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">
  1391 + 该店不可售
  1392 + </view>
  1393 + <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act && !is_normal}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">
  1394 + 该店不可售
  1395 + </view>
  1396 +
1381 <block wx:else> 1397 <block wx:else>
1382 <!-- 根本就找不到门店 --> 1398 <!-- 根本就找不到门店 -->
1383 <block wx:if="{{!only_pk && !def_pickpu_list}}"> 1399 <block wx:if="{{!only_pk && !def_pickpu_list}}">
@@ -1633,7 +1649,8 @@ @@ -1633,7 +1649,8 @@
1633 <view class="fs30 xc-black3 address_name">{{item.pickup_name}} 1649 <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
1634 <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> 1650 <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text>
1635 <text class="c-red22" wx:elif="{{item.is_no_dis}}">(配送不匹配)</text> 1651 <text class="c-red22" wx:elif="{{item.is_no_dis}}">(配送不匹配)</text>
1636 - <text class="c-red22" wx:elif="{{item.is_no_dis_nor && is_normal==1}}">(配送不匹配)</text> 1652 + <text class="c-red22" wx:elif="{{item.is_no_dis_nor && is_normal}}">(该店不可售)</text>
  1653 + <text class="c-red22" wx:elif="{{item.is_no_dis_act && !is_normal}}">(该店不可售)</text>
1637 </view> 1654 </view>
1638 </view> 1655 </view>
1639 <view> 1656 <view>
@@ -1661,9 +1678,10 @@ @@ -1661,9 +1678,10 @@
1661 <view class="flex-vertical-between "> 1678 <view class="flex-vertical-between ">
1662 <view class="flex xc-ash"> 1679 <view class="flex xc-ash">
1663 <view class="fs30 xc-black3 address_name">{{item.pickup_name}} 1680 <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
1664 - <text class="c-red22" wx:if="{{item.is_no_qyt }}">(库存不足)</text>  
1665 <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text> 1681 <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
1666 - <text class="c-red22" wx:if="{{item.is_no_dis_nor && is_normal==1}}">(配送不匹配)</text> 1682 + <text class="c-red22" wx:elif="{{item.is_no_dis_nor && is_normal}}">(该店不可售)</text>
  1683 + <text class="c-red22" wx:elif="{{item.is_no_dis_act && !is_normal}}">(该店不可售)</text>
  1684 + <text class="c-red22" wx:elif="{{item.is_no_qyt }}">(库存不足)</text>
1667 </view> 1685 </view>
1668 </view> 1686 </view>
1669 <view> 1687 <view>