nowTime: Date.now() // 当前时间戳
countDown: 15 * 60 // 15分钟
let tempTime = Date.parse(时间.replace(/-/g,"/"))
let timeCut = parseInt( ((Number(this.nowTime) - Number(tempTime)) / 1000 ) )
this.countDown = this.countDown - timeCut
setInterval(() => {
this.countDown--
}, 1000)
// 补0
formatBit (val) {
val = +val
return val > 9 ? val : '0' + val
},
formatSeconds (time = this.countDown) {
let min = Math.floor(time % 3600)
let val = this.formatBit(Math.floor(min / 60)) + ':' + this.formatBit(time % 60)
return val
}
倒计时15分钟 兼容ios 安卓 web
最新推荐文章于 2023-06-19 16:57:09 发布

3万+

被折叠的 条评论
为什么被折叠?



