Commit faed903e158c7cae672110e3263ce66c117f53a7
1 parent
ff3268f4
优化搭配购
Showing
1 changed file
with
9 additions
and
6 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -588,7 +588,7 @@ Page({ |
588 | 588 | var collocation_list = []; |
589 | 589 | var pick = null; |
590 | 590 | var distr_t = 0; |
591 | - | |
591 | + | |
592 | 592 | //如果是购物车的时候, |
593 | 593 | if (arr) { |
594 | 594 | var idx = th.data.allsto.findIndex(function (e) { |
... | ... | @@ -625,7 +625,7 @@ Page({ |
625 | 625 | } |
626 | 626 | } |
627 | 627 | }) |
628 | - | |
628 | + | |
629 | 629 | if (!collocation_list) return null; |
630 | 630 | |
631 | 631 | var new_arr = []; |
... | ... | @@ -1158,6 +1158,7 @@ Page({ |
1158 | 1158 | get_buy_goods: function (e) { |
1159 | 1159 | var th = this; |
1160 | 1160 | var gg = to.get_b_now(); |
1161 | + | |
1161 | 1162 | //--------如果goods_id一样,就是要立即购买----- |
1162 | 1163 | if (e == gg.goods_id) { |
1163 | 1164 | a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, { |
... | ... | @@ -1260,16 +1261,18 @@ Page({ |
1260 | 1261 | th.setData({ card_cut_price: cut_p }); |
1261 | 1262 | } |
1262 | 1263 | } |
1264 | + | |
1263 | 1265 | |
1264 | - //-- 判断是不是可以收藏 -- | |
1265 | - if (gd.prom_type == 5 && !th.data.all_collocation_list.length) { | |
1266 | - await th.set_collection(gd); | |
1267 | - } | |
1268 | 1266 | |
1269 | 1267 | //-- 当是搭配购的时候 -- |
1270 | 1268 | gd.prom_type = gg.prom_type ? gg.prom_type : 0; |
1271 | 1269 | gd.prom_id = gg.prom_id ? gg.prom_id : 0; |
1272 | 1270 | |
1271 | + //-- 判断是不是可以收藏 -- | |
1272 | + if (gd.prom_type == 5 && !th.data.all_collocation_list.length) { | |
1273 | + | |
1274 | + await th.set_collection(gd); | |
1275 | + } | |
1273 | 1276 | |
1274 | 1277 | if (gd.whsle_id > 0) { |
1275 | 1278 | gd.prom_type = gg.prom_type = 0; | ... | ... |