diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index c6ddec8..2d496ce 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -551,7 +551,7 @@ Page({ }else{ //未找到商品的活动 - is_flag = 0; + isok = 0; } }) if (!isok){ @@ -597,10 +597,7 @@ Page({ item.prom_type=3; item.prom_id=r_data.promGoodsLists[0].prom_id; }else if(r_data.ladderLists){ - var url = '/api/weshop/cart/update'; - getApp().request.put(url, { - data:{id:item.id,store_id:oo.stoid,prom_type:10,prom_id:r_data.ladderLists[0].form_id} - }); + item.prom_type=10; item.prom_id=r_data.ladderLists[0].form_id; @@ -644,24 +641,29 @@ Page({ if (!isok){ item.prom_type=0; item.prom_id=0; - continue; + }else{ + var url = '/api/weshop/cart/update'; + getApp().request.put(url, { + data:{id:item.id,store_id:oo.stoid,prom_type:10,prom_id:act.id} + }); - } - th.data.ladder_map[item.prom_id]=act; - //-- 获取阶梯规则 -- - var url1 = "/api/weshop/prom/ladderList/list"; - var req_data = { - store_id: os.stoid, - form_id: item.prom_id, - } - await getApp().request.promiseGet(url1, { - data: req_data - }).then(rs1 => { - if (rs1.data.code==0 && rs1.data.data) { - var gdlist = rs1.data.data; - th.data.ladder_map[item.prom_id].ladder_list=gdlist; + th.data.ladder_map[item.prom_id]=act; + //-- 获取阶梯规则 -- + var url1 = "/api/weshop/prom/ladderList/list"; + var req_data = { + store_id: os.stoid, + form_id: item.prom_id, } - }) + await getApp().request.promiseGet(url1, { + data: req_data + }).then(rs1 => { + if (rs1.data.code==0 && rs1.data.data) { + var gdlist = rs1.data.data; + th.data.ladder_map[item.prom_id].ladder_list=gdlist; + } + }) + } + } //直接把活动赋值给元素 if(th.data.ladder_map[item.prom_id] && th.data.ladder_map[item.prom_id]!=-1 ){ diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 1b55ae1..869c147 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -126,6 +126,7 @@ Page({ in_zhact_gdmap:{}, //不同门店参与同一活动的限购 hid_inp:1, user_note:{}, + zhhe_act_map:{}, //组合活动的map表 zuhe_map_good:{}, //组合购的map表 ladder_map:{}, //阶梯促销的map表 @@ -484,6 +485,7 @@ Page({ isok = 0; } item1.act = res.data.data; + th.data.zhhe_act_map[item1.prom_id] = res.data.data; } else { //未找到商品的活动 is_flag = 0; @@ -517,6 +519,10 @@ Page({ } }) } + else + { + item1.act = th.data.zhhe_act_map[item1.prom_id]; + } } if(item1.prom_type==10){ if(!th.data.ladder_map[item1.prom_id]){ @@ -1455,8 +1461,8 @@ Page({ if(item[j].prom_type!=7 && item[j].prom_type!=10 ) is_no_zh=1; //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加 - if(item[j].prom_type==7 && zh_prom_goods && zh_prom_goods[item[j].prom_id] - && zh_prom_goods[item[j].prom_id].act.is_orderyh ) + if(item[j].prom_type==7 && th.data.zhhe_act_map && th.data.zhhe_act_map[item[j].prom_id] + && th.data.zhhe_act_map[item[j].prom_id].is_orderyh ) { is_no_zh=1; } @@ -2586,7 +2592,10 @@ Page({ goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2); goods.pricing_type = g_item.pricing_type; } - + if(g_item.quan_num){ + goods.quan_num=g_item.quan_num; + goods.quan_no=g_item.quan_no; + } //--判断活动的类型-- switch (g_item.prom_type) { case 1: @@ -3633,6 +3642,16 @@ Page({ } } + var prom_pt_json= ep.prom_pt_json; + if(prom_pt_json){ + for(let oj in prom_pt_json){ + let item_j=prom_pt_json[oj]; + if(item_j.ladder_prom_id){ + cut_price += parseFloat(item_j.dis); + } + } + } + arr[ind].ckeck_quan_price = ckeck_quan_price - cut_price; arr[ind].check_quan_ware_list = check_quan_ware_list; arr[ind].check_quan_price_list = check_quan_price_list; @@ -4054,7 +4073,7 @@ Page({ //进行对商品的平摊g_item是单个商品,you_item是这个商品分多少优惠券的钱,goods是商品列表 split_set_goods_quanprice:async function (you_item,t_item) { - var coupon_price=t_item.coupon_price; + var coupon_price=you_item.WareCashSum; var goods=t_item.goods; var arr=[]; //判断是不是有goods_id重复 diff --git a/pages/cart/cart2/zh_calculate.js b/pages/cart/cart2/zh_calculate.js index f42189f..c23727e 100644 --- a/pages/cart/cart2/zh_calculate.js +++ b/pages/cart/cart2/zh_calculate.js @@ -15,6 +15,7 @@ module.exports = { let act_item = zh_prom_goods[i]; let act_goos = act_item.gdlist; let act = act_item.act; + if(!act) continue; let all_num = 0; //商品数量之和 let all_price0 = 0; //商品数量之和 @@ -103,7 +104,7 @@ module.exports = { } //当满足组合的要求:总数要满足,起购数要满足 - if (all_num >= act.zhbuyqty && !need_to_buy) { + if (act && all_num >= act.zhbuyqty && !need_to_buy) { //商品的列表 for (var u in act_goos) { diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 46f0caa..3c52c12 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -39,6 +39,8 @@ Page({ orderSn: options.orderSn, getUserID: d.user_id, }) + + if(options.lbId) th.data.lbId=options.lbId; //-- 获取分享人的ID -- var first_leader = options.first_leader || getApp().globalData.first_leader; if (first_leader) { diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 676e1b0..1f2403f 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3708,7 +3708,16 @@ Page({ //如果是秒杀的时候 if(th.data.prom_type==0 && gd.prom_type == 1 ){ gd.prom_type= 0; - } + } + //如果全场优惠,商品做了秒杀 + if(th.data.prom_type==3 && gd.prom_type == 1 ){ + gd.prom_type= 0; + } + //如果全场阶梯优惠,商品做了秒杀 + if(th.data.prom_type==10 && gd.prom_type == 1 ){ + gd.prom_type= 0; + } + if (!th.data.is_normal && ( gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6)) { //----获取活动购买数---- diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index 42a60cc..66f2cc5 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -22,7 +22,8 @@ Page({ is_hot:0, prom_goods_list:null, rq_data:null, - isToggle: false, //切换商品视图控制符 + isToggle: false, //切换商品视图控制符 + show_all:1, //判断显示 }, onLoad: function(t) { @@ -115,6 +116,21 @@ Page({ }).then(res=>{ if(res.data.code==0 && res.data.data){ var arr= res.data.data; + + if(arr.is_end==1){ + th.setData({show_all:0,err_txt:'活动已结束'}); + return false; + } + if(arr.start_time>ut.gettimestamp()){ + th.setData({show_all:0,err_txt:'活动还未开始'}); + return false; + } + if(arr.end_time - + @@ -292,10 +292,10 @@ 暂无相关商品 - 回到首页 + 回到首页 -