diff --git a/ext.json b/ext.json index 9051b53..3e6d3cc 100644 --- a/ext.json +++ b/ext.json @@ -4,7 +4,7 @@ "ext": { "weappId": "wxea71200db93d756b", "name": "富茂客官开发", - "appVersion": "C.3.5.6", + "appVersion": "C.3.5.8", "attr": { "ifHaveCarModular": "1", "etcpversion": "release", diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index e8470c2..7858a9c 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -39,7 +39,6 @@ Page({ result: [], end_time: null, checked: false, - clock: "已经截止", questionnaire: {}, questionId: null, widthScreen: null, @@ -60,7 +59,7 @@ Page({ statusText: '', isReceived: false, receivedDisabled: false, - clock: "00", + clock: "结束", day: "00", hour: "00", min: "00", @@ -300,6 +299,7 @@ Page({ var total_micro_second = EndTime - NowTime || []; // 渲染倒计时时钟 let obj = that.dateformat(total_micro_second); + console.log(total_micro_second) if (total_micro_second > 0) { that.setData({ clock: obj, @@ -316,41 +316,12 @@ Page({ min: "00", sec: "00", }) - that.getDetail(that.data.couponChannelId); + //如果倒计时结束,需要重新查询一下券的状态 + // 给getDetail一个标识 + that.getDetail(that.data.couponChannelId,'endclock'); } total_micro_second -= 1000; }, - // countdown02(end_time) { - // let that = this; - // var EndTime = end_time; - // var NowTime = new Date().getTime(); - // var total_micro_second = EndTime - NowTime || []; - // // 渲染倒计时时钟 - // let obj = that.dateformat(total_micro_second); - // if (total_micro_second > 0) { - // that.setData({ - // clock02: obj, - // day02: obj.a1, - // hour02: obj.b1, - // min02: obj.c1, - // sec02: obj.d1, - // }) - // } else { - // that.setData({ - // clock02: "00", - // day02: "0", - // hour02: "00", - // min02: "00", - // sec02: "00", - // showbutton1: false - // }) - // } - // console.log(that.data.showbutton1) - // setTimeout(function() { - // total_micro_second -= 1000; - // that.countdown02(end_time); - // }, 1000) - // }, countdown: function(end_time) { let that = this; that.setIntervalTime(end_time); @@ -387,7 +358,7 @@ Page({ wx.showLoading({ title: "加载中..." }); - that.getDetail(options.couponChannelId); + that.getDetail(options.couponChannelId,'notendclock'); /** * 转赠判断 */ @@ -408,7 +379,7 @@ Page({ }) } }, - getDetail: function(couponChannelId) { + getDetail: function (couponChannelId, flag) { let that = this; var parmer = { url: config.api.couponDetail, @@ -438,19 +409,19 @@ Page({ showbutton1: true }) } - //如果是砍价券 - // if (res.data.type == 8) { - // that.countdown02(res.data.validStartDate); - // } + console.log(flag); if (res.data.endTime && res.data.beginTime) { //activityStatus==0 活动未开始 //activityStatus==1 活动已开始 - if (res.data.activityStatus == 0) { + // flag == endclock 说明倒计时已经结束 + if (res.data.activityStatus == 0 && flag != 'endclock') { that.countdown(res.data.beginTime); - } else { + } else if (res.data.activityStatus != 0 && flag != 'endclock'){ that.countdown(res.data.endTime); + }else{ + clearInterval(that.data.setInterval) } - //当前时间与优惠券下架时间做计算 + if (res.data.activityStatus == 0) { var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); if (util.timechuo(beginTime).indexOf('-') == 0) { @@ -833,6 +804,10 @@ Page({ showbutton1:false }) }, + onUnload:function(){ + let that = this; + clearInterval(that.data.setInterval) + }, onShareAppMessage: function(options) { var that = this; var shareObj = { diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index c131317..1f6b5b4 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -17,10 +17,10 @@ 距结束 : 距开始 : - + 已经结束 - + {{day}}天: diff --git a/pages/rushToBuy/index.js b/pages/rushToBuy/index.js index 6da5696..7cbf3c4 100644 --- a/pages/rushToBuy/index.js +++ b/pages/rushToBuy/index.js @@ -71,7 +71,6 @@ Page({ for (let i = 0; i < that.data.list.length; i++) { var startTime = util.formatTime(that.data.list[i].endTime, "yyyy-MM-dd hh:mm:ss"); var beginTimes = util.formatTime(that.data.list[i].beginTime, "yyyy-MM-dd hh:mm:ss"); - console.log(that.data.list[i].activityStatus) var alsell = Math.floor((that.data.list[i].inventory - (that.data.list[i].remainInventory))/(that.data.list[i].inventory)*100); /** * 修改list的endtime @@ -82,7 +81,6 @@ Page({ var flags = 'list[' + i + '].flags'; var alsells = 'list[' + i + '].alsells'; //活动未开始 - console.log(beginTime) if (that.data.list[i].activityStatus==0){ if (util.timechuo(beginTime).indexOf('-') == 0) { that.setData({ diff --git a/pages/rushToBuy/index.wxml b/pages/rushToBuy/index.wxml index 7ddde68..ce4b21a 100644 --- a/pages/rushToBuy/index.wxml +++ b/pages/rushToBuy/index.wxml @@ -20,9 +20,9 @@ 距结束: - 距开始还有: + 距开始: 活动已结束 - {{item.endtime}} {{beginTime}} + {{item.endtime}} {{item.beginTime}}