Commit 4eb04adfc52cae27ff8c5c112bd1e1c3378b524d
1 parent
78982f96
多促销的优化
Showing
2 changed files
with
20 additions
and
1 deletions
packageE/pages/cart/cart2/cart2.wxml
| ... | ... | @@ -98,6 +98,7 @@ |
| 98 | 98 | <!----商品名称规格----> |
| 99 | 99 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}"> |
| 100 | 100 | <view class="goods-name ellipsis-2">{{items.goods_name}}</view> |
| 101 | + <view class="goods-name ellipsis-2">{{items.goods_name}}</view> | |
| 101 | 102 | <!-- 商品属性 --> |
| 102 | 103 | <view class="flex-vertical fs28 color-gray n_guige"> |
| 103 | 104 | <view class="goods-color"> | ... | ... |
utils/more_cx.js
| ... | ... | @@ -297,7 +297,7 @@ module.exports = { |
| 297 | 297 | return false; |
| 298 | 298 | }, |
| 299 | 299 | //-- 判读一下促销分组的问题 -- |
| 300 | - //-- is_need_ck_num 是多门店计算的时候,数量是不是要累家计算 -- | |
| 300 | + //-- is_need_ck_num 是多门店计算的时候,数量是不是要累家计算,主要是拿来计算限购 -- | |
| 301 | 301 | //-- need_ok是判断要不要满足条件 -- |
| 302 | 302 | async cart_cx_group(th,goods,car_item,is_need_ck_num,need_ok,func){ |
| 303 | 303 | |
| ... | ... | @@ -370,8 +370,26 @@ module.exports = { |
| 370 | 370 | |
| 371 | 371 | //-- 把活动进行规整 -- |
| 372 | 372 | var more_cx=c_item.more_cx; |
| 373 | + if(!more_cx) continue; | |
| 373 | 374 | for (var j=0;j<more_cx.length;j++){ |
| 374 | 375 | var n_item=more_cx[j]; |
| 376 | + //--- 当是组合购的时候,这个地方要开始计算限购 is_need_ck_num=1-- | |
| 377 | + if(n_item.prom_type==7 && is_need_ck_num){ | |
| 378 | + //判断是不是限购 | |
| 379 | + var zh_gd_fd=n_item.gdlist.find((e1)=>{ | |
| 380 | + return e1.goods_id==c_item.goods_id && e1.buyqty>0 | |
| 381 | + }) | |
| 382 | + | |
| 383 | + var in_zhact_gdmap_new=th.data.in_zhact_gdmap_new; | |
| 384 | + var key = c_item.goods_id + "." + n_item.prom_id; | |
| 385 | + | |
| 386 | + //如果是组合购 | |
| 387 | + if(zh_gd_fd && in_zhact_gdmap_new[key] && in_zhact_gdmap_new[key]>=zh_gd_fd.buyqty){ | |
| 388 | + continue; | |
| 389 | + } | |
| 390 | + } | |
| 391 | + | |
| 392 | + | |
| 375 | 393 | var key=n_item.prom_type+'-'+n_item.prom_id; |
| 376 | 394 | var fd=cx_act_map.find(function (e){ |
| 377 | 395 | return e.key==key; | ... | ... |