//倒计时 payTime() { //创建订单的时间 let createdAt = ( Date.parse(this.data.created_at))/1000; const IntervalTime = setInterval(() => { //获取当前时间 let t2 = (new Date().getTime() )/1000 //当前时间 - 创建的时间 == 剩余时间 let time = createdAt + 900 - t2 //分钟 let a = Math.floor(time / 60); let b = Math.floor(time - a * 60); this.rocallTime = `${a<10?'0'+a:a}:${b<10?'0'+b:b}` if(time == 0){ uni.navigateBack() } }, 1000); },
标签:返回,倒计时,let,time,时间,createdAt,1000 From: https://www.cnblogs.com/lucky06y/p/17086720.html