From 5cffb136c3b0a9c3bee3138c375334645f760353 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sun, 31 Dec 2023 10:23:00 +0800 Subject: [PATCH] 秒杀商品要使用优惠券 --- packageE/pages/cart/cart2/cart2.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index f73c883..51f583d 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -1509,6 +1509,11 @@ Page({ item1.is_post_temp=1; //如果是秒杀,团购的时候,优惠促销和搭配购的时候 if([1,2,3,5,6,7,10].indexOf(item1.prom_type)>-1){ + + if(item1.prom_type==1 || item1.prom_type==6) { + item1.is_quan=0; + } + var url= "/api/weshop/activitylist/getSJGoodsPriceNew/" + os.stoid + "/" + item1.goods_id + "/"+item1.prom_type+"/" + item1.prom_id + "/" + app.globalData.user_id; await app.request.promiseGet(url,{}).then(res=>{ @@ -1521,6 +1526,11 @@ Page({ }else item1.is_order_yh=0; item1.is_post_temp=res.data.data.is_post_temp; + + if(item1.prom_type==1 || item1.prom_type==6) { + item1.is_quan=res.data.data.is_quan; + } + } }) } @@ -2007,7 +2017,6 @@ Page({ //t.data.data.shop_price = tt.data.data.prom_price; gd.shop_price=t.data.data.shop_price = tt.data.data.prom_user_price; th.data.ckeck_quan_price = 0; - gd.is_xz_yh = 1; t.data.data.fir_rate = tt.data.data.fir_rate; t.data.data.sec_rate = tt.data.data.sec_rate; @@ -2045,6 +2054,14 @@ Page({ } + if (tt.data.data.is_quan) { + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; + } else { + gd.is_xz_yh = 1; + } + th.setData({ bn_goods: gd, @@ -3910,6 +3927,7 @@ Page({ is_by_quan = 1; } } + if (!is_by_quan) { var user_addr = th.data.user_addr; var req_d = { @@ -6409,7 +6427,7 @@ Page({ for (var i in goodlist) { var gd = goodlist[i]; //--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券-- - if (gd.whsle_id == 1 || gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act && gd.act.is_xz_yh) || gd.is_xz_yh == 1) { + if (gd.whsle_id == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act && gd.act.is_xz_yh) || gd.is_xz_yh == 1) { continue; } @@ -6420,6 +6438,10 @@ Page({ } } + //--如果是秒杀,要判断有没有限制使用优惠券 + if (gd.prom_type == 1 && !gd.is_quan) { + continue; + } //--如果是团购,要判断有没有限制使用优惠券 if (gd.prom_type == 2) { -- libgit2 0.21.4