diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 7858a9c..106a0bb 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -299,7 +299,6 @@ 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, @@ -358,6 +357,9 @@ Page({ wx.showLoading({ title: "加载中..." }); + that.setData({ + onshow:false + }) that.getDetail(options.couponChannelId,'notendclock'); /** * 转赠判断 @@ -411,6 +413,10 @@ Page({ } console.log(flag); if (res.data.endTime && res.data.beginTime) { + that.setData({ + begin_time: res.data.beginTime, + end_time: res.data.endTime, + }) //activityStatus==0 活动未开始 //activityStatus==1 活动已开始 // flag == endclock 说明倒计时已经结束 @@ -421,7 +427,6 @@ Page({ }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) { @@ -803,11 +808,18 @@ Page({ showbutton: false, showbutton1:false }) + if(this.data.end_time){ + this.countdown(this.data.end_time) + } }, onUnload:function(){ let that = this; clearInterval(that.data.setInterval) }, + onHide: function () { + let that = this; + clearInterval(that.data.setInterval) + }, onShareAppMessage: function(options) { var that = this; var shareObj = {