Commit 334f5ea1819050ed2838c0f292eb7982723dbc79

Authored by yvan.ni
1 parent 3fc23ad0

组合购的限购的优化

packageE/pages/cart/cart2/cart2.js
... ... @@ -1223,6 +1223,22 @@ Page({
1223 1223 //要在多活动确定之后,在来计算
1224 1224 for (var jh = 0; jh < arr[k].goods.length; jh++) {
1225 1225 var item1 = arr[k].goods[jh]
  1226 +
  1227 +
  1228 + if(arr[k].show_can_cx){
  1229 + for (let key_o in arr[k].show_can_cx) {
  1230 + let k_arr=key_o.split(',');
  1231 + if(k_arr.indexOf(item1.goods_id+'')>-1 ){
  1232 + //-- 如果初始活动在计算的时候,是不满足的时候,就要把活动清理掉 --
  1233 + var is_no_ok=arr[k].show_can_cx[key_o].cur_act.is_no_ok;
  1234 + if(is_no_ok==1){
  1235 + item1.prom_id = 0;
  1236 + item1.prom_type = 0;
  1237 + }
  1238 + }
  1239 + }
  1240 + }
  1241 +
1226 1242 //要把优惠活动加入,prom_goods_map中,赠品不要运算,代发商品不算优惠
1227 1243 if (item1.prom_type == 3 && item1.is_gift != 1 && !item1.whsle_id) {
1228 1244 // th.check_is_youhui(item1.goods_id, item1.pick_id);
... ... @@ -1254,6 +1270,7 @@ Page({
1254 1270  
1255 1271 //要把组合购的东西拿出来算一下,同时组合购的总数量要有存在
1256 1272 if (item1.prom_type == 7) {
  1273 +
1257 1274 if (!th.data.zuhe_map_good[item1.prom_id]) {
1258 1275 var isok = 1;
1259 1276 var is_flag = 1;
... ... @@ -1325,6 +1342,8 @@ Page({
1325 1342  
1326 1343  
1327 1344 } else {
  1345 +
  1346 +
1328 1347 item1.act = th.data.zhhe_act_map[item1.prom_id];
1329 1348 }
1330 1349 }
... ...