Commit 028e1d98e950809a6e85cd34a8231cb271ac6fb5
1 parent
01e8d045
订单促销取价的优化
Showing
9 changed files
with
106 additions
and
12 deletions
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... | ... | @@ -1480,6 +1480,22 @@ Page({ |
1480 | 1480 | goods.is_integral_normal=1; |
1481 | 1481 | goods.prom_type=0; |
1482 | 1482 | goods.prom_id=0; |
1483 | + | |
1484 | + //如果是指定门店,就要判断 | |
1485 | + if (th.data.bn_goods.pick_group_ids) { | |
1486 | + var idx0 = th.data.bn_goods.pick_up_lists.findIndex(function (e) { | |
1487 | + return e.pickup_id == th.data.bn_pick; | |
1488 | + }) | |
1489 | + if (idx0 < 0) { | |
1490 | + getApp().my_warnning(th.data.bn_goods.goods_name + "的门店不可售", 0, th); | |
1491 | + th.data.is_summit_ing = 0; | |
1492 | + th.setData({ | |
1493 | + submit: 0 | |
1494 | + }) | |
1495 | + return false; | |
1496 | + } | |
1497 | + } | |
1498 | + | |
1483 | 1499 | } |
1484 | 1500 | |
1485 | 1501 | if (getApp().globalData.skinface_id) { |
... | ... | @@ -2242,11 +2258,6 @@ Page({ |
2242 | 2258 | good.prom_id=0; |
2243 | 2259 | good.discount_field=discount_field; |
2244 | 2260 | |
2245 | - //把优惠券的使用还原 | |
2246 | - th.setData({ | |
2247 | - selected_quan_list: null, | |
2248 | - using_quan: {} | |
2249 | - }) | |
2250 | 2261 | |
2251 | 2262 | }else{ |
2252 | 2263 | good=ut.deep_cp(th.data.old_bn_goods); |
... | ... | @@ -2263,9 +2274,6 @@ Page({ |
2263 | 2274 | }) |
2264 | 2275 | th.calculatePrice2() |
2265 | 2276 | |
2266 | - if(!th.data.can_use_ord_prom[pickid]){ | |
2267 | - th.get_buy_now_quan(); | |
2268 | - } | |
2269 | 2277 | } |
2270 | 2278 | |
2271 | 2279 | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -1590,6 +1590,22 @@ Page({ |
1590 | 1590 | //如果有参与非实收的订单促销,那么就相当于是普通购买 |
1591 | 1591 | if(th.data.can_use_ord_prom[th.data.bn_pick]){ |
1592 | 1592 | goods.is_integral_normal=1; |
1593 | + //如果是指定门店,就要判断 | |
1594 | + if (th.data.bn_goods.pick_group_ids) { | |
1595 | + var idx0 = th.data.bn_goods.pick_up_lists.findIndex(function (e) { | |
1596 | + return e.pickup_id == th.data.bn_pick; | |
1597 | + }) | |
1598 | + if (idx0 < 0) { | |
1599 | + getApp().my_warnning(th.data.bn_goods.goods_name + "的门店不可售", 0, th); | |
1600 | + th.data.is_summit_ing = 0; | |
1601 | + th.setData({ | |
1602 | + submit: 0 | |
1603 | + }) | |
1604 | + return false; | |
1605 | + } | |
1606 | + } | |
1607 | + | |
1608 | + | |
1593 | 1609 | } |
1594 | 1610 | |
1595 | 1611 | ... | ... |
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -1388,6 +1388,26 @@ Page({ |
1388 | 1388 | //-- 如果初始活动在计算的时候,是不满足的时候,就要把活动清理掉 -- |
1389 | 1389 | var is_no_ok=arr[k].show_can_cx[key_o].cur_act.is_no_ok; |
1390 | 1390 | if(is_no_ok==1){ |
1391 | + | |
1392 | + let temp_id=arr[k].show_can_cx[key_o].cur_act.prom_id; | |
1393 | + switch (parseInt(arr[k].show_can_cx[key_o].cur_act.prom_type+'')){ | |
1394 | + case 3: | |
1395 | + var yhcx_act_map=th.data.yhcx_act_map?th.data.yhcx_act_map[temp_id]:null; | |
1396 | + if(yhcx_act_map && !yhcx_act_map.is_order_yh){ | |
1397 | + item1.is_no_order_yh=1; | |
1398 | + } | |
1399 | + break; | |
1400 | + case 7: | |
1401 | + var zhhe_act=th.data.zhhe_act_map?th.data.zhhe_act_map[temp_id]:null; | |
1402 | + if(zhhe_act && !zhhe_act.is_orderyh){ | |
1403 | + item1.is_no_order_yh=1; | |
1404 | + } | |
1405 | + break; | |
1406 | + } | |
1407 | + | |
1408 | + debugger; | |
1409 | + | |
1410 | + | |
1391 | 1411 | item1.prom_id = 0; |
1392 | 1412 | item1.prom_type = 0; |
1393 | 1413 | |
... | ... | @@ -3061,6 +3081,7 @@ Page({ |
3061 | 3081 | |
3062 | 3082 | } |
3063 | 3083 | |
3084 | + | |
3064 | 3085 | //调用函数计算每件商品的单价 |
3065 | 3086 | await th.calc_per(c_arr); |
3066 | 3087 | |
... | ... | @@ -3174,8 +3195,9 @@ Page({ |
3174 | 3195 | |
3175 | 3196 | //--------循环计算总价----------- |
3176 | 3197 | for (var jc = 0; jc < item.length; jc++) { |
3177 | - | |
3178 | - if (item[jc].prom_type == 0 && !item[jc].whsle_id) { //如果item的prom_type==0,没有如果活动的时候 | |
3198 | + //如果item的prom_type==0,没有如果活动的时候,如果是优惠促销和组合促销不满足的时候 | |
3199 | + //或者是组合购和阶梯购多出来的商品 | |
3200 | + if (item[jc].prom_type == 0 && !item[jc].whsle_id && !item[jc].is_no_order_yh) { | |
3179 | 3201 | th.get_order_prom_map_ck(item[jc],pickid); |
3180 | 3202 | } |
3181 | 3203 | |
... | ... | @@ -4983,9 +5005,9 @@ Page({ |
4983 | 5005 | return false; |
4984 | 5006 | } |
4985 | 5007 | } |
5008 | + } | |
4986 | 5009 | |
4987 | 5010 | |
4988 | - } | |
4989 | 5011 | |
4990 | 5012 | if (th.data.bn_goods.whsle_id) { |
4991 | 5013 | item.is_whsle = 1; | ... | ... |
packageE/pages/cart/cart2/ladder_calculate.js
... | ... | @@ -115,6 +115,11 @@ module.exports = { |
115 | 115 | }) |
116 | 116 | //goods[idx].goods_num -= num; |
117 | 117 | let new_g = JSON.parse(JSON.stringify(goods[idx])); |
118 | + | |
119 | + //多余的商品如果活动不参与订单促销,那么变成普通商品的也不能参与订单促销,2024-2-26 | |
120 | + if(!ladder_map.is_useorderyh){ | |
121 | + new_g.is_no_order_yh=1; | |
122 | + } | |
118 | 123 | new_g.goods_num = num; |
119 | 124 | new_g.prom_type = 0; |
120 | 125 | new_g.prom_id = 0; | ... | ... |
packageE/pages/cart/cart2/zh_calculate.js
... | ... | @@ -270,6 +270,11 @@ module.exports = { |
270 | 270 | let new_g = JSON.parse(JSON.stringify(goods[idx])); |
271 | 271 | |
272 | 272 | if(new_g.more_cx) delete new_g.more_cx; |
273 | + | |
274 | + //多余的商品如果活动不参与订单促销,那么变成普通商品的也不能参与订单促销,2024-2-26 | |
275 | + if(!act.is_orderyh){ | |
276 | + new_g.is_no_order_yh=1; | |
277 | + } | |
273 | 278 | new_g.goods_num = num; |
274 | 279 | new_g.prom_type = 0; |
275 | 280 | new_g.prom_id = 0; |
... | ... | @@ -331,6 +336,11 @@ module.exports = { |
331 | 336 | offline_price += item.goods_price - item.offline_price; |
332 | 337 | offline_num += 1; |
333 | 338 | } |
339 | + | |
340 | + //多余的商品如果活动不参与订单促销,那么变成普通商品的也不能参与订单促销,2024-2-26 | |
341 | + if(!act.is_orderyh){ | |
342 | + item.is_no_order_yh=1; | |
343 | + } | |
334 | 344 | item.prom_type = 0; |
335 | 345 | item.prom_id = 0; |
336 | 346 | } | ... | ... |
packageE/pages/cart/cart2_inte/cart2_inte.js
... | ... | @@ -1343,6 +1343,22 @@ Page({ |
1343 | 1343 | //如果有参与非实收的订单促销,那么就相当于是普通购买 |
1344 | 1344 | if(th.data.can_use_ord_prom[th.data.bn_pick]){ |
1345 | 1345 | goods.is_integral_normal=1; |
1346 | + | |
1347 | + //如果是指定门店,就要判断 | |
1348 | + if (th.data.bn_goods.pick_group_ids) { | |
1349 | + var idx0 = th.data.bn_goods.pick_up_lists.findIndex(function (e) { | |
1350 | + return e.pickup_id == th.data.bn_pick; | |
1351 | + }) | |
1352 | + if (idx0 < 0) { | |
1353 | + getApp().my_warnning(th.data.bn_goods.goods_name + "的门店不可售", 0, th); | |
1354 | + th.data.is_summit_ing = 0; | |
1355 | + th.setData({ | |
1356 | + submit: 0 | |
1357 | + }) | |
1358 | + return false; | |
1359 | + } | |
1360 | + } | |
1361 | + | |
1346 | 1362 | } |
1347 | 1363 | |
1348 | 1364 | if(getApp().globalData.skinface_id){ | ... | ... |
packageE/pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -1491,6 +1491,22 @@ Page({ |
1491 | 1491 | //如果有参与非实收的订单促销,那么就相当于是普通购买 |
1492 | 1492 | if(th.data.can_use_ord_prom[th.data.bn_pick]){ |
1493 | 1493 | goods.is_integral_normal=1; |
1494 | + | |
1495 | + //如果是指定门店,就要判断 | |
1496 | + if (th.data.bn_goods.pick_group_ids) { | |
1497 | + var idx0 = th.data.bn_goods.pick_up_lists.findIndex(function (e) { | |
1498 | + return e.pickup_id == th.data.bn_pick; | |
1499 | + }) | |
1500 | + if (idx0 < 0) { | |
1501 | + getApp().my_warnning(th.data.bn_goods.goods_name + "的门店不可售", 0, th); | |
1502 | + th.data.is_summit_ing = 0; | |
1503 | + th.setData({ | |
1504 | + submit: 0 | |
1505 | + }) | |
1506 | + return false; | |
1507 | + } | |
1508 | + } | |
1509 | + | |
1494 | 1510 | } |
1495 | 1511 | |
1496 | 1512 | if (getApp().globalData.skinface_id) { | ... | ... |
packageE/pages/cart/cart_wk/cart_wk.js