diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 97226f6..763ac51 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -5103,6 +5103,26 @@ Page({ } } + //看一下有没有活动不参与的,要记录到order_more表中 + let can_cx=t_item.show_can_cx; + let is_user_no_yhcx=null; + for(let iu in can_cx){ + if(can_cx[iu].no_cj_prom){ + + if(!is_user_no_yhcx) is_user_no_yhcx=[]; + is_user_no_yhcx.push({ + prom_id:can_cx[iu].cur_act.prom_id, + prom_type:can_cx[iu].cur_act.prom_type, + }) + break; + } + } + //如果有活动不参与的,要记录到order_more表中 + if(is_user_no_yhcx){ + item.is_user_no_yhcx=JSON.stringify(is_user_no_yhcx); + } + + //代发商品的集合 var df_goods = []; var df_price = 0; @@ -5112,7 +5132,8 @@ Page({ //此单的组合活动汇总 var zh_map_count={}; var check_map = {}; - let groupchat_ids=[] + let groupchat_ids=[]; + //-------------让商品添加到商品列表-------------------- for (var k = 0; k < t_item.goods.length; k++) { @@ -5473,6 +5494,8 @@ Page({ } // debugger var str = JSON.stringify(pdata); + + wx.showLoading({ title: "加载中" }); th.setData({ submit: 1, }) diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index 100abaa..67f3291 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -178,6 +178,7 @@ Page({ r.use_commission=res.data.data.use_commission; r.pre_cut=res.data.data.pre_cut; //预存款 r.pre_json=res.data.data.pre_json; //预存款 + r.is_user_no_yhcx = res.data.data.is_user_no_yhcx; //判断订单是不是优惠促销不参与 } }) @@ -911,6 +912,7 @@ Page({ }) + //商品的订单列表的活动类型,和gg参与的类型不一致 if(good.prom_type != gg.prom_type && good.prom_id != gg.prom_id){ //如果商品有单独的活动的是偶 switch (gg.prom_type){ @@ -923,17 +925,31 @@ Page({ case 3: var prom=null; var yh_check=1; - await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { - if (res.data.code == 0) { prom = res.data.data; } - }) - if (prom && prom.limit_num) { - var limit_num = prom.limit_num; - var user_pre_buynum = await this.getUserBuyPromNum_pre(prom.id) - if (limit_num>0 && user_pre_buynum >= limit_num) { + + + //如果有优惠促销的普通购买的时候 + if(order.is_user_no_yhcx && good.prom_type==0 && order.is_user_no_yhcx!='0' && order.is_user_no_yhcx!='null' ){ + let obj=JSON.parse(order.is_user_no_yhcx); + //obj数组使用find函数快速查找 + if(obj.find((item)=>{return item.prom_id==gg.prom_id && item.prom_type==3})){ yh_check=0; } } + //判断优惠促销活动的限购 + if(yh_check){ + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { + if (res.data.code == 0) { prom = res.data.data; } + }) + if (prom && prom.limit_num) { + var limit_num = prom.limit_num; + var user_pre_buynum = await this.getUserBuyPromNum_pre(prom.id) + if (limit_num>0 && user_pre_buynum >= limit_num) { + yh_check=0; + } + } + } + //--- 要判断一下优惠促销的商品的限购 --- if(yh_check){ var pro_gd_limit_num=0; @@ -957,7 +973,7 @@ Page({ if(gd_limit_rs && gd_limit_rs.data.code==0){ pro_by_num=gd_limit_rs.data.data.promgoodsbuynum } - if(pro_gd_limit_num<=pro_by_num){ + if(pro_gd_limit_num { - if (res.data.code == 0) { prom = res.data.data; } - }) - if (prom && prom.limit_num) { - var limit_num = prom.limit_num; - var user_pre_buynum = await this.getUserBuyPromNum_pre(prom.id) - if (limit_num>0 && user_pre_buynum >= limit_num) { - yh_check=0; - } - } + + + //如果有优惠促销的普通购买的时候 + if(order.is_user_no_yhcx && good.prom_type==0 && order.is_user_no_yhcx!='0' && order.is_user_no_yhcx!='null' ){ + let obj=JSON.parse(order.is_user_no_yhcx); + //obj数组使用find函数快速查找 + if(obj.find((item)=>{return item.prom_id==gg.prom_id && item.prom_type==3})){ + yh_check=0; + } + } + + //判断优惠促销活动的限购 + if(yh_check){ + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { + if (res.data.code == 0) { prom = res.data.data; } + }) + if (prom && prom.limit_num) { + var limit_num = prom.limit_num; + var user_pre_buynum = await this.getUserBuyPromNum_pre(prom.id) + if (limit_num>0 && user_pre_buynum >= limit_num) { + yh_check=0; + } + } + } //--- 要判断一下优惠促销的商品的限购 --- if(yh_check){ @@ -1249,7 +1265,7 @@ Page({ if(gd_limit_rs && gd_limit_rs.data.code==0){ pro_by_num=gd_limit_rs.data.data.promgoodsbuynum } - if(pro_gd_limit_num<=pro_by_num){ + if(pro_gd_limit_num