|
|
@@ -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 = { |
|
|
|