Commit c54c818e17d9ae1386e32776b49fe11e4d685674
1 parent
ffb8b07c
判断是不是有参与搭配商品,和后台一起判断是不是有参与搭配促销活动
Showing
1 changed file
with
19 additions
and
5 deletions
packageE/pages/cart/cart2/cart2.js
| ... | ... | @@ -4876,6 +4876,9 @@ Page({ |
| 4876 | 4876 | var zh_map_count={}; |
| 4877 | 4877 | var check_map = {}; |
| 4878 | 4878 | let groupchat_ids=[] |
| 4879 | + | |
| 4880 | + | |
| 4881 | + | |
| 4879 | 4882 | //-------------让商品添加到商品列表-------------------- |
| 4880 | 4883 | for (var k = 0; k < t_item.goods.length; k++) { |
| 4881 | 4884 | |
| ... | ... | @@ -4894,7 +4897,6 @@ Page({ |
| 4894 | 4897 | }; |
| 4895 | 4898 | |
| 4896 | 4899 | |
| 4897 | - | |
| 4898 | 4900 | if (getApp().globalData.skinface_id) { |
| 4899 | 4901 | goods.skinface_id = getApp().globalData.skinface_id; |
| 4900 | 4902 | } |
| ... | ... | @@ -4942,11 +4944,15 @@ Page({ |
| 4942 | 4944 | } |
| 4943 | 4945 | break; |
| 4944 | 4946 | case 5: |
| 4945 | - goods.prom_type = 5; | |
| 4946 | - goods.prom_id = g_item.prom_id; | |
| 4947 | - if (g_item.is_collocation) { | |
| 4948 | - goods.is_collocation = g_item.is_collocation; | |
| 4947 | + //看一下有没有搭配商品 | |
| 4948 | + if(th.has_collocation(t_item.goods,g_item.prom_id)){ | |
| 4949 | + goods.prom_type = 5; | |
| 4950 | + goods.prom_id = g_item.prom_id; | |
| 4951 | + if (g_item.is_collocation) { | |
| 4952 | + goods.is_collocation = g_item.is_collocation; | |
| 4953 | + } | |
| 4949 | 4954 | } |
| 4955 | + | |
| 4950 | 4956 | break |
| 4951 | 4957 | case 7: |
| 4952 | 4958 | goods.prom_type = 7; |
| ... | ... | @@ -5367,6 +5373,14 @@ Page({ |
| 5367 | 5373 | }) |
| 5368 | 5374 | |
| 5369 | 5375 | }, |
| 5376 | + //看一下有没有选择搭配的商品 | |
| 5377 | + has_collocation(goods,prom_id){ | |
| 5378 | + var idx=goods.findIndex(function (e){ | |
| 5379 | + return e.prom_type==5 && e.prom_id==prom_id && e.is_collocation; | |
| 5380 | + }) | |
| 5381 | + return idx>0; | |
| 5382 | + }, | |
| 5383 | + | |
| 5370 | 5384 | //---确认线下门店的数量足不足--- |
| 5371 | 5385 | async check_store_num(goods_id, pick, goods_num, func) { |
| 5372 | 5386 | var lock = 0, pick_no, plist, erpwareid; | ... | ... |