diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index b8a25cd..48a4978 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -55,6 +55,7 @@ Page({ openPromModal: !1, activeCategoryId: 0, supportPageScroll: !1, + prom_type4:0, //积分购是否开始 address: { address: "", district: 0 @@ -902,7 +903,13 @@ Page({ failRollback: !0, success: function (t) { console.log(t); + // t.data.data.prom_type=0 if (t.data.code == 0) { + if(t.data.data && t.data.data.prom_type==4){ + if(ee.data.prom_type4==1){ + t.data.data.prom_type=0 + } + } if (t.data.data.is_on_sale != 1) { wx.showModal({ title: '商品已经下架', @@ -7492,9 +7499,24 @@ Page({ success: function (e) { if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { var arr = e.data.data; + let times = new Date().getTime() + arr.map(item=>{ + //如果是积分购的话,要进行活动时间判断 + if(item.prom_type==4){ + let atimes= item.warm_uptime*1000 + if(atimes > times){ + item.prom_type=0 + th.setData({ + prom_type4:1 + }) + } + } + }) + var arr2 = arr.filter(function (e) { return e.s_time < ut.gettimestamp(); }) + //-- 如果只有一个活动的话 -- if (arr.length == 1) { th.data.prom_type = arr[0].prom_type;