From 559eaecedb74456d763a0f208931eda4773392a5 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 29 Nov 2023 18:12:12 +0800 Subject: [PATCH] 秒杀门店不可售 --- pages/goods/goodsInfo/goodsInfo.js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 7477b9c..7a61c2e 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3439,7 +3439,7 @@ Page({ } else that.get_sto(null,()=>{ that.sele_spec_next(that,item,gid,nor); - }); + },item); }, @@ -3671,7 +3671,7 @@ Page({ //---------拿出门店分类和门店------------ - get_sto(e,func) { + get_sto(e,func,item) { console.log('get_sto') var th = this, that = this; @@ -3744,9 +3744,15 @@ Page({ if(!is_normal && py>0 && [3,5,7,10].indexOf(py)<0 ){ pickup_ids=null; } + //-- 把秒杀的指定对象带入 -- + if(item){ + if(item.is_pickup && item.pick_up_lists){ + pickup_ids=item.pick_up_lists + }else{ + pickup_ids=null; + } - //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 - if(!is_normal && [1,2,6].indexOf(py)>-1 && th.data.prom_act.pick_up_lists){ + }else if(!is_normal && [1,2,6].indexOf(py)>-1 && th.data.prom_act.pick_up_lists){ //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 pickup_ids=th.data.prom_act.pick_up_lists } @@ -3867,18 +3873,26 @@ Page({ } if(func) func(); }else{ + + if(func) func(); + th.setData({sp_seleing:0}) wx.hideLoading(); } } else { + if(func) func(); + th.setData({sp_seleing:0}) wx.hideLoading(); } },err=>{ ut.m_toast('网络繁忙,请稍后重试'); + if(func) func(); + th.setData({sp_seleing:0}) wx.hideLoading(); }) }, 200) }, + //获取搜索门店输入的值 input_store: function (e) { this.setData({ @@ -8537,14 +8551,13 @@ Page({ let item = f_more[i]; f_more[i].prom_id = item.act_id; f_more[i].prom_type = 1; - if (item.goods_id == this.data.data.goods_id) { - continue; - } + var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; await getApp().request.promiseGet(url, {}).then(rs => { if (rs.data.code == 0 && rs.data.data) { f_more[i].price = rs.data.data.user_price; - + f_more[i].is_pickup = rs.data.data.is_pickup; + f_more[i].pick_up_lists = rs.data.data.pick_up_lists; } }) } -- libgit2 0.21.4