Commit dc6f07dbadb7809a5ca0271b15a0554cdc17eac1

Authored by yvan.ni
1 parent c468d000

购物车的优化

packageE/pages/cart/cart2/cart2.js
@@ -1153,7 +1153,8 @@ Page({ @@ -1153,7 +1153,8 @@ Page({
1153 var c_item = arr[k]; 1153 var c_item = arr[k];
1154 if(!is_change){ 1154 if(!is_change){
1155 //-- 要进行归类一下活动 -- 1155 //-- 要进行归类一下活动 --
1156 - await m_cx.cart_cx_group(th,arr[k].goods,c_item,0,1,(show_can_cx)=>{ 1156 + await m_cx.cart_cx_group(th,arr[k].goods,c_item,0,0,(show_can_cx)=>{
  1157 +
1157 arr[k].show_can_cx=show_can_cx; 1158 arr[k].show_can_cx=show_can_cx;
1158 }) 1159 })
1159 }else{ 1160 }else{
@@ -1189,12 +1190,13 @@ Page({ @@ -1189,12 +1190,13 @@ Page({
1189 } 1190 }
1190 } 1191 }
1191 //-- 如果组合购的总数量不足的处理 -- 1192 //-- 如果组合购的总数量不足的处理 --
1192 - if(no_zh_num[item1.prom_id] && item1.prom_type == 7){  
1193 - item1.prom_type = 0;  
1194 - item1.prom_type1 = 0;  
1195 - item1.prom_id = 0;  
1196 - item1.prom_id1 = 0  
1197 - } 1193 + // if(no_zh_num[item1.prom_id] && item1.prom_type == 7){
  1194 + // item1.prom_type = 0;
  1195 + // item1.prom_type1 = 0;
  1196 + // item1.prom_id = 0;
  1197 + // item1.prom_id1 = 0
  1198 + // }
  1199 +
1198 //要把组合购的东西拿出来算一下,同时组合购的总数量要有存在 1200 //要把组合购的东西拿出来算一下,同时组合购的总数量要有存在
1199 if (item1.prom_type == 7) { 1201 if (item1.prom_type == 7) {
1200 if (!th.data.zuhe_map_good[item1.prom_id]) { 1202 if (!th.data.zuhe_map_good[item1.prom_id]) {
@@ -1219,10 +1221,10 @@ Page({ @@ -1219,10 +1221,10 @@ Page({
1219 store_count_ok = 0; 1221 store_count_ok = 0;
1220 no_zh_num[item1.prom_id]=1; 1222 no_zh_num[item1.prom_id]=1;
1221 //-- 清理一下活动的状态 -- 1223 //-- 清理一下活动的状态 --
1222 - item1.prom_type = 0;  
1223 - item1.prom_type1 = 0;  
1224 - item1.prom_id = 0;  
1225 - item1.prom_id1 = 0 1224 + // item1.prom_type = 0;
  1225 + // item1.prom_type1 = 0;
  1226 + // item1.prom_id = 0;
  1227 + // item1.prom_id1 = 0
1226 1228
1227 }else{ 1229 }else{
1228 th.data.zhhe_act_map[item1.prom_id] = res.data.data; 1230 th.data.zhhe_act_map[item1.prom_id] = res.data.data;
@@ -7703,6 +7705,12 @@ Page({ @@ -7703,6 +7705,12 @@ Page({
7703 var cx_prom_group=this.data.cartlist[idx].show_can_cx[gd_key].act_arr; 7705 var cx_prom_group=this.data.cartlist[idx].show_can_cx[gd_key].act_arr;
7704 var pk=this.data.cartlist[idx].pickup_id; 7706 var pk=this.data.cartlist[idx].pickup_id;
7705 7707
  7708 + th.setData({
  7709 + send_lb:{},
  7710 + month_lb:{}
  7711 + })
  7712 +
  7713 +
7706 var fir_sele=0; 7714 var fir_sele=0;
7707 for(var dx=0;dx<cx_prom_group.length;dx++){ 7715 for(var dx=0;dx<cx_prom_group.length;dx++){
7708 if(cx_prom_group[dx].sele) fir_sele=dx; 7716 if(cx_prom_group[dx].sele) fir_sele=dx;
packageE/pages/cart/cart2/cart2.wxml
@@ -116,7 +116,6 @@ @@ -116,7 +116,6 @@
116 </view> 116 </view>
117 <!-- 验证活动是不是多个,要不要显示切换 --> 117 <!-- 验证活动是不是多个,要不要显示切换 -->
118 <!-- 新增促销多活动的排版 --> 118 <!-- 新增促销多活动的排版 -->
119 -  
120 <block wx:if="{{(util.is_more_act(items,item.show_can_cx) && item.show_can_cx[items.goods_id] && item.show_can_cx[items.goods_id].act_arr.length>1)}}"> 119 <block wx:if="{{(util.is_more_act(items,item.show_can_cx) && item.show_can_cx[items.goods_id] && item.show_can_cx[items.goods_id].act_arr.length>1)}}">
121 <view class="bdb16" wx:if="{{util.check_show(items,item.show_can_cx[items.goods_id].sele_prom_type)}}"> 120 <view class="bdb16" wx:if="{{util.check_show(items,item.show_can_cx[items.goods_id].sele_prom_type)}}">
122 <view bindtap="switch_cx_group" 121 <view bindtap="switch_cx_group"
packageE/pages/cart/cart2/zh_calculate.js
@@ -305,6 +305,9 @@ module.exports = { @@ -305,6 +305,9 @@ module.exports = {
305 305
306 306
307 } else { 307 } else {
  308 +
  309 + goods[goods.length-1].is_act_last=1;
  310 +
308 for (let ii in goods) { 311 for (let ii in goods) {
309 let item = goods[ii]; 312 let item = goods[ii];
310 if (item.prom_type != 7) continue; 313 if (item.prom_type != 7) continue;
pages/cart/cart/cart.wxml
@@ -141,10 +141,10 @@ @@ -141,10 +141,10 @@
141 <view class="cx-sizs fs30">可参促销</view> 141 <view class="cx-sizs fs30">可参促销</view>
142 <view class="flex ai_c f1 pdh20"> 142 <view class="flex ai_c f1 pdh20">
143 <view class="xc-coupon-fram" wx:for="{{item.show_can_cx[items.goods_id].act_arr}}" > 143 <view class="xc-coupon-fram" wx:for="{{item.show_can_cx[items.goods_id].act_arr}}" >
144 - <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view>  
145 - <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view>  
146 - <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view>  
147 - <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word">阶梯促销</view> 144 + <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }}">优惠促销</view>
  145 + <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">搭配促销</view>
  146 + <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">组合购</view>
  147 + <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }}">阶梯促销</view>
148 </view> 148 </view>
149 </view> 149 </view>
150 <view class="cx-obtain-coupon wsize"> 150 <view class="cx-obtain-coupon wsize">
pages/cart/cart/cart.wxss
@@ -435,9 +435,13 @@ page { @@ -435,9 +435,13 @@ page {
435 /* margin:0 auto; */ 435 /* margin:0 auto; */
436 color: #fff; 436 color: #fff;
437 padding: 6rpx 20rpx; 437 padding: 6rpx 20rpx;
  438 +}
438 439
  440 +.xc-coupon-fram .xc-coupon.gray{
  441 + background-color: #bbb;
439 } 442 }
440 443
  444 +
441 .xc-coupon-fram .xc-circular { 445 .xc-coupon-fram .xc-circular {
442 width: 16rpx; 446 width: 16rpx;
443 height: 16rpx; 447 height: 16rpx;