Commit dc6f07dbadb7809a5ca0271b15a0554cdc17eac1

Authored by yvan.ni
1 parent c468d000

购物车的优化

packageE/pages/cart/cart2/cart2.js
... ... @@ -1153,7 +1153,8 @@ Page({
1153 1153 var c_item = arr[k];
1154 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 1158 arr[k].show_can_cx=show_can_cx;
1158 1159 })
1159 1160 }else{
... ... @@ -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 1201 if (item1.prom_type == 7) {
1200 1202 if (!th.data.zuhe_map_good[item1.prom_id]) {
... ... @@ -1219,10 +1221,10 @@ Page({
1219 1221 store_count_ok = 0;
1220 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 1229 }else{
1228 1230 th.data.zhhe_act_map[item1.prom_id] = res.data.data;
... ... @@ -7703,6 +7705,12 @@ Page({
7703 7705 var cx_prom_group=this.data.cartlist[idx].show_can_cx[gd_key].act_arr;
7704 7706 var pk=this.data.cartlist[idx].pickup_id;
7705 7707  
  7708 + th.setData({
  7709 + send_lb:{},
  7710 + month_lb:{}
  7711 + })
  7712 +
  7713 +
7706 7714 var fir_sele=0;
7707 7715 for(var dx=0;dx<cx_prom_group.length;dx++){
7708 7716 if(cx_prom_group[dx].sele) fir_sele=dx;
... ...
packageE/pages/cart/cart2/cart2.wxml
... ... @@ -116,7 +116,6 @@
116 116 </view>
117 117 <!-- 验证活动是不是多个,要不要显示切换 -->
118 118 <!-- 新增促销多活动的排版 -->
119   -
120 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 120 <view class="bdb16" wx:if="{{util.check_show(items,item.show_can_cx[items.goods_id].sele_prom_type)}}">
122 121 <view bindtap="switch_cx_group"
... ...
packageE/pages/cart/cart2/zh_calculate.js
... ... @@ -305,6 +305,9 @@ module.exports = {
305 305  
306 306  
307 307 } else {
  308 +
  309 + goods[goods.length-1].is_act_last=1;
  310 +
308 311 for (let ii in goods) {
309 312 let item = goods[ii];
310 313 if (item.prom_type != 7) continue;
... ...
pages/cart/cart/cart.wxml
... ... @@ -141,10 +141,10 @@
141 141 <view class="cx-sizs fs30">可参促销</view>
142 142 <view class="flex ai_c f1 pdh20">
143 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 148 </view>
149 149 </view>
150 150 <view class="cx-obtain-coupon wsize">
... ...
pages/cart/cart/cart.wxss
... ... @@ -435,9 +435,13 @@ page {
435 435 /* margin:0 auto; */
436 436 color: #fff;
437 437 padding: 6rpx 20rpx;
  438 +}
438 439  
  440 +.xc-coupon-fram .xc-coupon.gray{
  441 + background-color: #bbb;
439 442 }
440 443  
  444 +
441 445 .xc-coupon-fram .xc-circular {
442 446 width: 16rpx;
443 447 height: 16rpx;
... ...