diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index 2dcda9c..100abaa 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -933,6 +933,36 @@ Page({ yh_check=0; } } + + //--- 要判断一下优惠促销的商品的限购 --- + if(yh_check){ + var pro_gd_limit_num=0; + var p_limit_rs= await getApp().request.promisePost('/api/weshop/promgoods/getPromGoodsLimitNum',{ + data:{ + store_id:os.stoid,goods_id:gg.goods_id,prom_id:gg.prom_id,prom_type:3 + } + }) + if(p_limit_rs && p_limit_rs.data.code==0){ + pro_gd_limit_num=p_limit_rs.data.data + } + //-- 如果有商品限购的时候 -- + if(pro_gd_limit_num>0){ + var pro_by_num=0; + var lrs= { + store_id: os.stoid,user_id: getApp().globalData.user_id, + goods_id: gg.goods_id, prom_type: 3, + prom_id: gg.prom_id, isnew:1 + }; + var gd_limit_rs=await getApp().promiseGet('/api/weshop/ordergoods/getUserBuyGoodsNum',{data:lrs}); + 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){ + yh_check=0; + } + } + } + //-- 优惠促销活动没有超出限购的话 -- if(yh_check){ if(!the_yh_map[gg.prom_id]) the_yh_map[gg.prom_id]=[]; diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 94ecad2..ccb9ebd 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -1225,6 +1225,36 @@ Page({ yh_check=0; } } + + //--- 要判断一下优惠促销的商品的限购 --- + if(yh_check){ + var pro_gd_limit_num=0; + var p_limit_rs= await getApp().request.promisePost('/api/weshop/promgoods/getPromGoodsLimitNum',{ + data:{ + store_id:os.stoid,goods_id:gg.goods_id,prom_id:gg.prom_id,prom_type:3 + } + }) + if(p_limit_rs && p_limit_rs.data.code==0){ + pro_gd_limit_num=p_limit_rs.data.data + } + //-- 如果有商品限购的时候 -- + if(pro_gd_limit_num>0){ + var pro_by_num=0; + var lrs= { + store_id: os.stoid,user_id: getApp().globalData.user_id, + goods_id: gg.goods_id, prom_type: 3, + prom_id: gg.prom_id, isnew:1 + }; + var gd_limit_rs=await getApp().promiseGet('/api/weshop/ordergoods/getUserBuyGoodsNum',{data:lrs}); + 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){ + yh_check=0; + } + } + } + //-- 优惠促销活动没有超出限购的话 -- if(yh_check){ if(!the_yh_map[gg.prom_id]) the_yh_map[gg.prom_id]=[];