Commit 78982f9692bfb1e45629bcc4ffa77700020364c6
1 parent
627d5564
多促销的优化
Showing
2 changed files
with
22 additions
and
3 deletions
pages/cart/cart/cart.js
| @@ -1466,7 +1466,7 @@ Page({ | @@ -1466,7 +1466,7 @@ Page({ | ||
| 1466 | 1466 | ||
| 1467 | this.doCheckAll(function (){ | 1467 | this.doCheckAll(function (){ |
| 1468 | e.all_check_prom_activity(); | 1468 | e.all_check_prom_activity(); |
| 1469 | - }); | 1469 | + },1); |
| 1470 | 1470 | ||
| 1471 | } | 1471 | } |
| 1472 | } | 1472 | } |
| @@ -1875,7 +1875,7 @@ Page({ | @@ -1875,7 +1875,7 @@ Page({ | ||
| 1875 | }, | 1875 | }, |
| 1876 | 1876 | ||
| 1877 | //----------检查是否全选--------- | 1877 | //----------检查是否全选--------- |
| 1878 | - doCheckAll:async function (func) { | 1878 | + doCheckAll:async function (func,n_ok) { |
| 1879 | var th = this, | 1879 | var th = this, |
| 1880 | tfeel = 0, | 1880 | tfeel = 0, |
| 1881 | t_num = 0, | 1881 | t_num = 0, |
| @@ -1898,9 +1898,10 @@ Page({ | @@ -1898,9 +1898,10 @@ Page({ | ||
| 1898 | car[a].zh_map=null; | 1898 | car[a].zh_map=null; |
| 1899 | car[a].ladder_map=null; | 1899 | car[a].ladder_map=null; |
| 1900 | 1900 | ||
| 1901 | + | ||
| 1901 | var item = car[a].goods, is_s_sele = 1; | 1902 | var item = car[a].goods, is_s_sele = 1; |
| 1902 | //-- 先批量判断一下活动的类型,同时要同步跟新 -- | 1903 | //-- 先批量判断一下活动的类型,同时要同步跟新 -- |
| 1903 | - await m_cx.cart_cx_group(th,item,car[a],1,0,(show_can_cx)=>{ | 1904 | + await m_cx.cart_cx_group(th,item,car[a],1,n_ok,(show_can_cx)=>{ |
| 1904 | var offline_price = 0; | 1905 | var offline_price = 0; |
| 1905 | var offline_num = 0; | 1906 | var offline_num = 0; |
| 1906 | for (var c = 0; c < item.length; c++) { | 1907 | for (var c = 0; c < item.length; c++) { |
utils/more_cx.js
| @@ -519,6 +519,24 @@ module.exports = { | @@ -519,6 +519,24 @@ module.exports = { | ||
| 519 | }) | 519 | }) |
| 520 | //当满足组合的要求:总数要满足,起购数要满足 | 520 | //当满足组合的要求:总数要满足,起购数要满足 |
| 521 | if(this.ch_zh_ok(zh_pro0,zhact_gdlist,zh_goods,th,item_act_map,is_need_ck_num,need_ok)){ | 521 | if(this.ch_zh_ok(zh_pro0,zhact_gdlist,zh_goods,th,item_act_map,is_need_ck_num,need_ok)){ |
| 522 | + | ||
| 523 | + if(is_need_ck_num){ | ||
| 524 | + //先缓存活动数量 | ||
| 525 | + var need_ck=th.data.in_zhact_new[aid]?th.data.in_zhact_new[aid]:0; | ||
| 526 | + need_ck+=item_act_map.act_num; | ||
| 527 | + th.data.in_zhact_new[aid]=need_ck; | ||
| 528 | + | ||
| 529 | + if(item_act_map.in_zhact_gdmap){ | ||
| 530 | + var in_zhact_gdmap1 = item_act_map['in_zhact_gdmap']; | ||
| 531 | + for (var vg in in_zhact_gdmap1) { | ||
| 532 | + if (!th.data.in_zhact_gdmap_new[vg]) th.data.in_zhact_gdmap_new[vg] = 0; | ||
| 533 | + th.data.in_zhact_gdmap_new[vg] += in_zhact_gdmap1[vg]; | ||
| 534 | + } | ||
| 535 | + } | ||
| 536 | + | ||
| 537 | + | ||
| 538 | + } | ||
| 539 | + | ||
| 522 | can_calc_cx.push(item_act_map) | 540 | can_calc_cx.push(item_act_map) |
| 523 | } | 541 | } |
| 524 | break; | 542 | break; |