Commit cb5a1ee939c80306d50c60cf7e8aedce3c25a53c
1 parent
ab4fb495
搭配购优化
Showing
1 changed file
with
11 additions
and
2 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -1419,7 +1419,16 @@ Page({ |
1419 | 1419 | t.data.data.guide_id = gg.guide_id; |
1420 | 1420 | t.data.data.guide_type = gg.guide_type; |
1421 | 1421 | } |
1422 | - th.setData({ collocation_goods: gg.collocation_goods }); | |
1422 | + //搭配购如果原来就有勾选,不能直接赋值,旧的要保留 | |
1423 | + if(th.data.collocation_goods && th.data.collocation_goods.length){ | |
1424 | + if(gg.collocation_goods){ | |
1425 | + let coll_goods=th.data.collocation_goods | |
1426 | + coll_goods.push(...gg.collocation_goods) | |
1427 | + th.setData({collocation_goods:coll_goods}) | |
1428 | + } | |
1429 | + }else{ | |
1430 | + th.setData({ collocation_goods: gg.collocation_goods }); | |
1431 | + } | |
1423 | 1432 | |
1424 | 1433 | if (th.data.all_collocation_list && gg.collocation_goods) { |
1425 | 1434 | for (var i = 0; i < th.data.all_collocation_list.length; i++) { |
... | ... | @@ -2318,7 +2327,7 @@ Page({ |
2318 | 2327 | continue; |
2319 | 2328 | } |
2320 | 2329 | |
2321 | - debugger; | |
2330 | + | |
2322 | 2331 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp |
2323 | 2332 | && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) { |
2324 | 2333 | ... | ... |