Commit 3186d1dfc3066e6a005d3c8b7690ea971fbd3215
1 parent
c822ef91
组合购优化
Showing
1 changed file
with
8 additions
and
3 deletions
packageE/pages/cart/cart2/zh_calculate.js
@@ -11,6 +11,7 @@ module.exports = { | @@ -11,6 +11,7 @@ module.exports = { | ||
11 | offline_price = 0, | 11 | offline_price = 0, |
12 | offline_num = 0; | 12 | offline_num = 0; |
13 | let txt_ite = c_item.need_list; | 13 | let txt_ite = c_item.need_list; |
14 | + | ||
14 | //多个活动要拿来循环一下 | 15 | //多个活动要拿来循环一下 |
15 | for (let i in zh_prom_goods) { | 16 | for (let i in zh_prom_goods) { |
16 | let title = ""; //提示语; | 17 | let title = ""; //提示语; |
@@ -43,7 +44,11 @@ module.exports = { | @@ -43,7 +44,11 @@ module.exports = { | ||
43 | let item = act_goos[j]; | 44 | let item = act_goos[j]; |
44 | let item_j = goods.find(function (ele) { | 45 | let item_j = goods.find(function (ele) { |
45 | console.log('ele', ele); | 46 | console.log('ele', ele); |
46 | - return ele.goods_id == act_goos[j].goods_id; | 47 | + if (ele.prom_type==7) { |
48 | + return ele.goods_id == act_goos[j].goods_id; | ||
49 | + }else{ | ||
50 | + return false | ||
51 | + } | ||
47 | }) | 52 | }) |
48 | //-- 如果有找到的话 -- | 53 | //-- 如果有找到的话 -- |
49 | if (item_j) { | 54 | if (item_j) { |
@@ -117,7 +122,7 @@ module.exports = { | @@ -117,7 +122,7 @@ module.exports = { | ||
117 | } | 122 | } |
118 | 123 | ||
119 | } | 124 | } |
120 | - | 125 | + |
121 | //当满足组合的要求:总数要满足,起购数要满足 | 126 | //当满足组合的要求:总数要满足,起购数要满足 |
122 | if (act && all_num >= act.zhbuyqty && !need_to_buy) { | 127 | if (act && all_num >= act.zhbuyqty && !need_to_buy) { |
123 | //商品的列表 | 128 | //商品的列表 |
@@ -367,7 +372,7 @@ module.exports = { | @@ -367,7 +372,7 @@ module.exports = { | ||
367 | tfeel += aprice; | 372 | tfeel += aprice; |
368 | cut_price += all_price0 - aprice;; | 373 | cut_price += all_price0 - aprice;; |
369 | } | 374 | } |
370 | - | 375 | + |
371 | c_item.zh_all_price = tfeel; | 376 | c_item.zh_all_price = tfeel; |
372 | c_item.zh_cut_price = cut_price; | 377 | c_item.zh_cut_price = cut_price; |
373 | 378 |