Commit a8e5fd02ad27090661f71a658d6da29dca4bd708
1 parent
769464a8
搭配购主商品直接购买时订单页价格优化
Showing
1 changed file
with
14 additions
and
6 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -1194,7 +1194,7 @@ Page({ |
1194 | 1194 | }) |
1195 | 1195 | |
1196 | 1196 | } |
1197 | - | |
1197 | + | |
1198 | 1198 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
1199 | 1199 | t.data.data['buynum'] = gg.goods_num; |
1200 | 1200 | var distr_t = 0, et = 0 |
... | ... | @@ -1281,7 +1281,7 @@ Page({ |
1281 | 1281 | //-- 当是搭配购的时候 -- |
1282 | 1282 | gd.prom_type = gg.prom_type ? gg.prom_type : 0; |
1283 | 1283 | gd.prom_id = gg.prom_id ? gg.prom_id : 0; |
1284 | - | |
1284 | + | |
1285 | 1285 | //-- 判断是不是可以收藏 -- |
1286 | 1286 | if (gd.prom_type == 5 && !th.data.all_collocation_list.length) { |
1287 | 1287 | |
... | ... | @@ -2814,13 +2814,21 @@ Page({ |
2814 | 2814 | //---------计算立即购买---------- |
2815 | 2815 | calculatePrice2: async function (qfunc) { |
2816 | 2816 | var th = this, good = this.data.bn_goods; |
2817 | - | |
2817 | + | |
2818 | 2818 | if (!good) return false; |
2819 | 2819 | |
2820 | 2820 | //搭配的计算要用购物的车计算方法 |
2821 | - if (good.prom_type == 5) { | |
2822 | - th.calculatePrice(); | |
2823 | - return false; | |
2821 | + // if (good.prom_type == 5 ) { | |
2822 | + if (good.prom_type == 5 ) { | |
2823 | + if( th.data.old_cartlist && th.data.old_cartlist.length > 0){ | |
2824 | + th.calculatePrice(); | |
2825 | + return false; | |
2826 | + }else{ | |
2827 | + //如果搭配购搭配商品未空的话,让主商品的活动变成0,取消搭配购 | |
2828 | + th.setData({ 'bn_goods.prom_type': 0, 'bn_goods.prom_id': 0, collocation_goods: [] }); | |
2829 | + good.prom_type=0 | |
2830 | + good.prom_id=0 | |
2831 | + } | |
2824 | 2832 | } |
2825 | 2833 | |
2826 | 2834 | th.setData({ submit: 1 }); | ... | ... |