Commit 5cffb136c3b0a9c3bee3138c375334645f760353

Authored by yvan.ni
1 parent 71a42a79

秒杀商品要使用优惠券

packageE/pages/cart/cart2/cart2.js
... ... @@ -1509,6 +1509,11 @@ Page({
1509 1509 item1.is_post_temp=1;
1510 1510 //如果是秒杀,团购的时候,优惠促销和搭配购的时候
1511 1511 if([1,2,3,5,6,7,10].indexOf(item1.prom_type)>-1){
  1512 +
  1513 + if(item1.prom_type==1 || item1.prom_type==6) {
  1514 + item1.is_quan=0;
  1515 + }
  1516 +
1512 1517 var url= "/api/weshop/activitylist/getSJGoodsPriceNew/" + os.stoid
1513 1518 + "/" + item1.goods_id + "/"+item1.prom_type+"/" + item1.prom_id + "/" + app.globalData.user_id;
1514 1519 await app.request.promiseGet(url,{}).then(res=>{
... ... @@ -1521,6 +1526,11 @@ Page({
1521 1526 }else item1.is_order_yh=0;
1522 1527  
1523 1528 item1.is_post_temp=res.data.data.is_post_temp;
  1529 +
  1530 + if(item1.prom_type==1 || item1.prom_type==6) {
  1531 + item1.is_quan=res.data.data.is_quan;
  1532 + }
  1533 +
1524 1534 }
1525 1535 })
1526 1536 }
... ... @@ -2007,7 +2017,6 @@ Page({
2007 2017 //t.data.data.shop_price = tt.data.data.prom_price;
2008 2018 gd.shop_price=t.data.data.shop_price = tt.data.data.prom_user_price;
2009 2019 th.data.ckeck_quan_price = 0;
2010   - gd.is_xz_yh = 1;
2011 2020  
2012 2021 t.data.data.fir_rate = tt.data.data.fir_rate;
2013 2022 t.data.data.sec_rate = tt.data.data.sec_rate;
... ... @@ -2045,6 +2054,14 @@ Page({
2045 2054  
2046 2055 }
2047 2056  
  2057 + if (tt.data.data.is_quan) {
  2058 + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
  2059 + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
  2060 + th.data.check_quan_ware_list = t.data.data.erpwareid + "";
  2061 + } else {
  2062 + gd.is_xz_yh = 1;
  2063 + }
  2064 +
2048 2065  
2049 2066 th.setData({
2050 2067 bn_goods: gd,
... ... @@ -3910,6 +3927,7 @@ Page({
3910 3927 is_by_quan = 1;
3911 3928 }
3912 3929 }
  3930 +
3913 3931 if (!is_by_quan) {
3914 3932 var user_addr = th.data.user_addr;
3915 3933 var req_d = {
... ... @@ -6409,7 +6427,7 @@ Page({
6409 6427 for (var i in goodlist) {
6410 6428 var gd = goodlist[i];
6411 6429 //--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券--
6412   - 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) {
  6430 + if (gd.whsle_id == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act && gd.act.is_xz_yh) || gd.is_xz_yh == 1) {
6413 6431 continue;
6414 6432 }
6415 6433  
... ... @@ -6420,6 +6438,10 @@ Page({
6420 6438 }
6421 6439 }
6422 6440  
  6441 + //--如果是秒杀,要判断有没有限制使用优惠券
  6442 + if (gd.prom_type == 1 && !gd.is_quan) {
  6443 + continue;
  6444 + }
6423 6445  
6424 6446 //--如果是团购,要判断有没有限制使用优惠券
6425 6447 if (gd.prom_type == 2) {
... ...