diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index 0559c57..e1bdff7 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -81,7 +81,7 @@ Component({ //--调用接口,读取秒杀-- app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" - + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id, {}).then(res => { + + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id+"&type=1", {}).then(res => { console.log(res); //如果秒杀的数组为空的时候 var goodslist = res.data.data; @@ -113,6 +113,11 @@ Component({ //就算是添加的活动已经过期,就要用最新的活动 set_goods_list(g_id, goodslist) { + + goodslist.forEach(function (vy, indy) { + if(!vy.id) vy.id=vy.prom_id; + }) + // 判断火热,预热 var newTime = ut.gettimestamp(), all_array = [], th = this; th.setData({ newTime: newTime }); @@ -121,16 +126,14 @@ Component({ g_id.forEach(function (val, ind) { goodslist.forEach(function (vy, indy) { if (val.goodsid == vy.goods_id) { - if(!vy.id) vy.id=vy.prom_id; all_array.push(vy); } }) }) } else { - all_array = goodslist; + all_array = goodslist; } - if (all_array.length == 0) { all_array = goodslist; } diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 1499bcd..5ce06a8 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -836,7 +836,6 @@ Page({ t.data.data.prom_type=ee.data.prom_type; t.data.data.prom_id=ee.data.prom_id; } - ee.setData({ data: t.data.data, sele_g: t.data.data, @@ -1838,7 +1837,20 @@ Page({ return false; } - if(th.data.more_flash && open_store==1){ + var check_up=0; + if(th.data.more_flash){ + for(var i in th.data.more_flash){ + var item=th.data.more_flash[i]; + if(item.prom_type==1){ + check_up=1; + break + } + } + } + + + + if(check_up && open_store==1){ th.setData({is_pop_more:1}); }else{ var ind = t.currentTarget.dataset.ind; @@ -3096,9 +3108,8 @@ Page({ }); } }) - - } + if (prom_type == 1 && prom_id==0){ this.setData({ prom_type: 0,isshow: 1, @@ -4355,6 +4366,12 @@ Page({ context.fillText('强烈推荐', 64*unit, 672*unit); // 7.商品价格 let price = '¥' + this.data.data.shop_price; + + if(this.data.card_field && this.data.data[this.data.card_field]){ + price = '¥' + this.data.data[this.data.card_field]; + } + + // if (th.data.prom_act) // pri0 = th.data.prom_act.price; context.setFontSize(32*unit); @@ -4527,8 +4544,11 @@ Page({ context.setFontSize(23 * unit) context.setFillStyle("red") - var pri0 = th.data.data.shop_price; + if(th.data.card_field && th.data.data[th.data.card_field]){ + pri0=th.data.data[th.data.card_field]; + } + if (th.data.prom_act) pri0 = th.data.prom_price; pri0 = parseFloat(pri0).toFixed(2); diff --git a/pages/user/index/index.js b/pages/user/index/index.js index f16b45b..0dabb6b 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -462,7 +462,7 @@ Page({ }, setappdata: function(t) { var t=getApp().globalData.wxapp_buy_obj; - if (t.isout == 1) + if (t && t.isout == 1) wx.navigateTo({ url: "/pages/error/error?msg=小程序已经过期", });