Commit 559eaecedb74456d763a0f208931eda4773392a5
1 parent
05a3bf4c
秒杀门店不可售
Showing
1 changed file
with
21 additions
and
8 deletions
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -3439,7 +3439,7 @@ Page({ |
3439 | 3439 | } |
3440 | 3440 | else that.get_sto(null,()=>{ |
3441 | 3441 | that.sele_spec_next(that,item,gid,nor); |
3442 | - }); | |
3442 | + },item); | |
3443 | 3443 | |
3444 | 3444 | }, |
3445 | 3445 | |
... | ... | @@ -3671,7 +3671,7 @@ Page({ |
3671 | 3671 | |
3672 | 3672 | |
3673 | 3673 | //---------拿出门店分类和门店------------ |
3674 | - get_sto(e,func) { | |
3674 | + get_sto(e,func,item) { | |
3675 | 3675 | console.log('get_sto') |
3676 | 3676 | var th = this, |
3677 | 3677 | that = this; |
... | ... | @@ -3744,9 +3744,15 @@ Page({ |
3744 | 3744 | if(!is_normal && py>0 && [3,5,7,10].indexOf(py)<0 ){ |
3745 | 3745 | pickup_ids=null; |
3746 | 3746 | } |
3747 | + //-- 把秒杀的指定对象带入 -- | |
3748 | + if(item){ | |
3749 | + if(item.is_pickup && item.pick_up_lists){ | |
3750 | + pickup_ids=item.pick_up_lists | |
3751 | + }else{ | |
3752 | + pickup_ids=null; | |
3753 | + } | |
3747 | 3754 | |
3748 | - //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 | |
3749 | - if(!is_normal && [1,2,6].indexOf(py)>-1 && th.data.prom_act.pick_up_lists){ | |
3755 | + }else if(!is_normal && [1,2,6].indexOf(py)>-1 && th.data.prom_act.pick_up_lists){ //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 | |
3750 | 3756 | pickup_ids=th.data.prom_act.pick_up_lists |
3751 | 3757 | } |
3752 | 3758 | |
... | ... | @@ -3867,18 +3873,26 @@ Page({ |
3867 | 3873 | } |
3868 | 3874 | if(func) func(); |
3869 | 3875 | }else{ |
3876 | + | |
3877 | + if(func) func(); | |
3878 | + th.setData({sp_seleing:0}) | |
3870 | 3879 | wx.hideLoading(); |
3871 | 3880 | } |
3872 | 3881 | } else { |
3882 | + if(func) func(); | |
3883 | + th.setData({sp_seleing:0}) | |
3873 | 3884 | wx.hideLoading(); |
3874 | 3885 | } |
3875 | 3886 | },err=>{ |
3876 | 3887 | ut.m_toast('网络繁忙,请稍后重试'); |
3888 | + if(func) func(); | |
3889 | + th.setData({sp_seleing:0}) | |
3877 | 3890 | wx.hideLoading(); |
3878 | 3891 | }) |
3879 | 3892 | }, 200) |
3880 | 3893 | |
3881 | 3894 | }, |
3895 | + | |
3882 | 3896 | //获取搜索门店输入的值 |
3883 | 3897 | input_store: function (e) { |
3884 | 3898 | this.setData({ |
... | ... | @@ -8537,14 +8551,13 @@ Page({ |
8537 | 8551 | let item = f_more[i]; |
8538 | 8552 | f_more[i].prom_id = item.act_id; |
8539 | 8553 | f_more[i].prom_type = 1; |
8540 | - if (item.goods_id == this.data.data.goods_id) { | |
8541 | - continue; | |
8542 | - } | |
8554 | + | |
8543 | 8555 | var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; |
8544 | 8556 | await getApp().request.promiseGet(url, {}).then(rs => { |
8545 | 8557 | if (rs.data.code == 0 && rs.data.data) { |
8546 | 8558 | f_more[i].price = rs.data.data.user_price; |
8547 | - | |
8559 | + f_more[i].is_pickup = rs.data.data.is_pickup; | |
8560 | + f_more[i].pick_up_lists = rs.data.data.pick_up_lists; | |
8548 | 8561 | } |
8549 | 8562 | }) |
8550 | 8563 | } | ... | ... |