...
|
...
|
@@ -164,7 +164,33 @@ Page({ |
|
|
is_collect:res.data.is_collect,
|
|
|
count:res.data.count,
|
|
|
});
|
|
|
// self.countDown();
|
|
|
|
|
|
// (0全部,2待处理,4已拼成,5已取消,6已完成
|
|
|
|
|
|
// let newTime = new Date().getTime();//当前时间戳
|
|
|
// let end_time = app.nextTime(this.data.end_time, this.data.over_hours);//截止时间
|
|
|
// let endTime = new Date(end_time).getTime(); //截止时间戳
|
|
|
// if (endTime - newTime > 0) {}
|
|
|
const status = res.data.active.status;
|
|
|
if(status ===2 || status ===4 || status ===6 || status ===7) {
|
|
|
console.log('调用倒计时');
|
|
|
self.countDown();
|
|
|
}else {
|
|
|
console.log('不调用倒计时');
|
|
|
let countDownArr = [];
|
|
|
let obj = null;
|
|
|
obj = {
|
|
|
day: '00',
|
|
|
hou: '00',
|
|
|
min: '00',
|
|
|
sec: '00'
|
|
|
};
|
|
|
countDownArr.push(obj);
|
|
|
this.setData({
|
|
|
'detail.time': countDownArr,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
// wx.hideLoading()
|
|
|
})
|
...
|
...
|
@@ -187,14 +213,6 @@ Page({ |
|
|
console.log('确认拼餐', res);
|
|
|
if (+res.code === 1) {
|
|
|
wx.showToast({title:'拼餐成功',icon:'success'})
|
|
|
// self.setData({
|
|
|
// detail: res.data.active,
|
|
|
// end_time: res.data.active.time,
|
|
|
// over_hours:res.data.active.over_time,//几小时截止
|
|
|
// join_people: res.data.son,
|
|
|
// commenList:res.data.common
|
|
|
// });
|
|
|
// self.countDown();
|
|
|
}
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -203,7 +221,6 @@ Page({ |
|
|
},
|
|
|
|
|
|
countDown() { //倒计时函数
|
|
|
// 获取当前时间,同时得到活动结束时间数组
|
|
|
t = setTimeout(this.countDown, 1000);
|
|
|
let newTime = new Date().getTime();//当前时间戳
|
|
|
let end_time = app.nextTime(this.data.end_time, this.data.over_hours);//截止时间
|
...
|
...
|
@@ -226,8 +243,9 @@ Page({ |
|
|
sec: this.timeFormat(sec)
|
|
|
};
|
|
|
t;
|
|
|
|
|
|
console.log('活动未结束');
|
|
|
} else { //活动已结束,全部设置为'00'
|
|
|
console.log('活动已结束');
|
|
|
obj = {
|
|
|
day: '00',
|
|
|
hou: '00',
|
...
|
...
|
|