作者: | 来源:互联网 | 2023-09-15 20:03
倒计时this.timersetInterval(function(){vartime1newDate(res.data[0].uploadtime).getTime();
// 倒计时
this.timer = setInterval(function () {
var time1 = new Date(
res.data[0].uploadtime
).getTime();
var time2 = new Date().getTime();
var time30 = 30 * 60 * 1000;
var diff = time2 - time1;
if (diff <= time30) {
var min = parseInt((time30 - diff) / 1000 / 60);
var sec = parseInt(
((time30 - diff) / 1000) % 60
);
_this.countdown = min + " : " + sec;
} else {
_this.countdown = “已超时”;
}
}, 500);