diff --git a/packageA/pages/goodsInfo/buy_flash_normal.wxml b/packageA/pages/goodsInfo/buy_flash_normal.wxml index 42280d9..9d2b13d 100644 --- a/packageA/pages/goodsInfo/buy_flash_normal.wxml +++ b/packageA/pages/goodsInfo/buy_flash_normal.wxml @@ -30,7 +30,7 @@ - + {{def_pick_store.pickup_name}} 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} @@ -50,7 +50,7 @@ (库存不足) - (配送不匹配) + (该店不可售) (库存不足) @@ -97,7 +97,7 @@ - 配送不匹配 + 该店不可售 diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index f8b8197..1881f0d 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -431,53 +431,7 @@ Page({ // gallery = g; // }) - - // ----> 秒杀 - let prom_type = this.data.options.prom_type; - - let goods_id = this.data.options.goods_id; - if(!goods_id) goods_id = this.data.data.goods_id; - - if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 - let prom_id = this.data.options.prom_id; - // 检查活动是否开始 - this.check_prom(goods_id, prom_type, prom_id); - - } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 - getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { - data: { - store_id: os.stoid, - goods_id: goods_id, - goods_type: 1, - user_id: oo.user_id, - } - }).then(res => { - if (res.data.code == 0) { - let result = res.data.data; - let resLength = result.length; - if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动 - let goods_id = this.data.options.goods_id; - let prom_type = result[0].prom_type; - let prom_id = result[0].act_id; - this.setData({ - 'options.prom_type': prom_type, - 'options.prom_id': prom_id, - }); - // 检查活动是否开始 - this.check_prom(goods_id, prom_type, prom_id); - } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 - this.setData({ - actList: res.data.data, - }); - }; - - }else{ - this.setData({ - actList: res.data.data, - }); - } - }); - }; + // <---- 秒杀 //------是否收藏---------- @@ -764,11 +718,55 @@ Page({ // mapurl: t.data.data.listServiceVideos[0].video_url, // mapurl_f_img: t.data.data.listServiceVideos[0].video_img, //listServiceItem: t.data.data.listServiceItem, - 'isshow':1 - }); that.getTaohe(); + // ----> 秒杀 + let prom_type = th.data.options.prom_type; + + let goods_id = th.data.options.goods_id; + if(!goods_id) goods_id = th.data.data.goods_id; + + if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 + let prom_id = th.data.options.prom_id; + // 检查活动是否开始 + th.check_prom(goods_id, prom_type, prom_id); + + } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 + getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { + data: { + store_id: os.stoid, + goods_id: goods_id, + goods_type: 1, + user_id: oo.user_id, + } + }).then(res => { + if (res.data.code == 0) { + let result = res.data.data; + let resLength = result.length; + if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动 + let goods_id = th.data.options.goods_id; + let prom_type = result[0].prom_type; + let prom_id = result[0].act_id; + th.setData({ + 'options.prom_type': prom_type, + 'options.prom_id': prom_id, + }); + // 检查活动是否开始 + th.check_prom(goods_id, prom_type, prom_id); + } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 + th.setData({ + actList: res.data.data, + }); + }; + + }else{ + th.setData({ + actList: res.data.data, + }); + } + }); + }; // console.log('0xxxxx999999', t.data.data); //-----商品详情--- @@ -1604,9 +1602,9 @@ Page({ if(th.data.sele_g && th.data.sele_g.share_imgurl) { img = th.data.iurl + th.data.sele_g.share_imgurl; ob.imageUrl = img; - }; - }; - + } + } + return ob; }, @@ -1631,7 +1629,19 @@ Page({ //---------拿出门店分类和门店------------ get_sto(e) { + var is_normal=e; var th = this,that=this; + + if (e == 1) { + th.setData({ + is_normal: 1 + }) + } else { + th.setData({ + is_normal: 0 + }) + } + var timer_get = setInterval(function() { if (th.data.is_get_local_ok == 0) return false; if (!th.data.fir_def_store) return false; @@ -1684,11 +1694,12 @@ Page({ //删除 e.data.data.pageData.splice(k--, 1); } - } + } + } //如果有秒杀的指定门店 - if(th.data.prom_type==1 && th.data.prom_act && th.data.prom_act.pick_up_lists && e.data.data.pageData.length){ + if(th.data.prom_type==1 && th.data.prom_act && th.data.prom_act.pick_up_lists && e.data.data.pageData.length && !is_normal){ var pick_up_lists=th.data.prom_act.pick_up_lists; for (var kq = 0; kq < e.data.data.pageData.length; kq++) { var it0=e.data.data.pageData[kq]; @@ -1742,7 +1753,7 @@ Page({ e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 } - th.setData({all_pick_list:e.data.data.pageData}); + th.setData({all_pick_list:e.data.data.pageData,isshow:1}); th.deal_pickup(e); } else{ @@ -3554,7 +3565,6 @@ Page({ get_normal(gid) { this.setData({ prom_type: 0, - isshow: 1, }); // this.get_sku(os.stoid, this.data.data, gid); this.get_sto(); @@ -3589,7 +3599,7 @@ Page({ if (prom_type == 1 && prom_id == 0) { this.setData({ - prom_type: 0, isshow: 1, + prom_type: 0 }); //获取门店 @@ -3658,7 +3668,6 @@ Page({ prom_act: t.data.data, prom_end_time: prom_end_time, prom_start_time: prom_start_time, - isshow: 1, }); ee.get_sto(); @@ -3932,18 +3941,18 @@ Page({ // 是否授权登陆 var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/packageE/pages/togoin/togoin', - }) - return false; - } - + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/packageE/pages/togoin/togoin', + }) + return false; + } this.data.g_buy_num = new Map(); var th = this; this.setData({open_ind_store: 5, goodsInputNum: 1});//拼团直接给4 - this.setData({openSpecModal_flash_normal: 1}); + this.setData({openSpecModal_flash_normal: 1}); + this.get_sto(1) // if (th.data.sku_g_pt) { @@ -3961,7 +3970,7 @@ Page({ }, closeSpecModal_flash_normal: function () { - this.setData({openSpecModal_flash_normal: 0}); + this.setData({openSpecModal_flash_normal: 0,is_normal:0}); }, diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml index 3d51015..f6ef259 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/goodsInfo/goodsInfo.wxml @@ -172,7 +172,7 @@ (未找到门店) (未找到门店) - (该店不可售) + (该店不可售) (该店不可售) @@ -666,7 +666,7 @@ - + {{def_pick_store.pickup_name}} 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} @@ -837,7 +837,7 @@ (该店不可售) - (该店不可售) + (该店不可售1) @@ -869,7 +869,7 @@ (该店不可售) - (该店不可售) + (该店不可售) @@ -902,7 +902,7 @@ (该店不可售) - (该店不可售) + (该店不可售) diff --git a/packageA/pages/goodsInfo/goodsInfo.wxss b/packageA/pages/goodsInfo/goodsInfo.wxss index 875222b..592c7c7 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxss +++ b/packageA/pages/goodsInfo/goodsInfo.wxss @@ -2417,9 +2417,7 @@ height: 90rpx; margin: auto; */ } -.shop_name{ -} .stores-img{ width: 28rpx; height: 28rpx; @@ -2427,6 +2425,7 @@ margin: auto; */ } .shop_name{ margin-right: 10rpx; + max-width: 375rpx; } .address{ /* width: 100%;