diff --git a/components/cart_collect_temp/cart_collect_temp.wxml b/components/cart_collect_temp/cart_collect_temp.wxml index a73eaa0..ea36cc8 100644 --- a/components/cart_collect_temp/cart_collect_temp.wxml +++ b/components/cart_collect_temp/cart_collect_temp.wxml @@ -13,9 +13,9 @@ binderror="bind_bnerr3" data-img="{{item.original_img}}"> {{item.goods_name}} - + {{item.price}} - + diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index b723660..c6ce982 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -1420,25 +1420,32 @@ Page({ t.data.data.guide_type = gg.guide_type; } //搭配购如果原来就有勾选,不能直接赋值,旧的要保留 - if(th.data.collocation_goods && th.data.collocation_goods.length){ - if(gg.collocation_goods){ - let coll_goods=th.data.collocation_goods - coll_goods.push(...gg.collocation_goods) - th.setData({collocation_goods:coll_goods}) - } - }else{ + if(!th.data.collocation_goods){ th.setData({ collocation_goods: gg.collocation_goods }); } + // if(th.data.collocation_goods && th.data.collocation_goods.length){ + // if(gg.collocation_goods){ + // let coll_goods=th.data.collocation_goods + // coll_goods.push(...gg.collocation_goods) + // th.setData({collocation_goods:coll_goods}) + // } + // }else{ + // th.setData({ collocation_goods: gg.collocation_goods }); + // } if (th.data.all_collocation_list && gg.collocation_goods) { for (var i = 0; i < th.data.all_collocation_list.length; i++) { var item0 = th.data.all_collocation_list[i]; var idx = gg.collocation_goods.findIndex(function (e) { - return e.goods_id == item0.goods_id && e.prom_id == item0.prom_id; + // return e.goods_id == item0.goods_id && e.prom_id == item0.prom_id; + return e.goods_id == item0.goods_id; }) if (idx != -1) { var txt = 'all_collocation_list[' + i + '].selected'; th.setData({ [txt]: 1 }); + }else{ + var txt = 'all_collocation_list[' + i + '].selected'; + th.setData({ [txt]: 0 }); } } @@ -6423,7 +6430,7 @@ Page({ //要进行深拷贝 var coll_arr_new = JSON.parse(JSON.stringify(coll_arr)); coll_arr_new.unshift(this.data.bn_goods); - await th.get_collocation_list(coll_arr); + await th.get_collocation_list(coll_arr_new); //计算价格 th.calculatePrice2(); th.get_cart_quan(); diff --git a/packageE/pages/cart/cart2/cart2.wxml b/packageE/pages/cart/cart2/cart2.wxml index a614ff9..304d3fd 100644 --- a/packageE/pages/cart/cart2/cart2.wxml +++ b/packageE/pages/cart/cart2/cart2.wxml @@ -384,7 +384,7 @@ - +