倒计时优化

develop
jialong.yu 3 years ago
parent 9e5a041508
commit f6b96bacf3
  1. 16
      src/components/TestPanel.vue

@ -469,14 +469,14 @@ export default {
let leave1 = counterTime % (24 * 3600) //
let leave2 = leave1 % 3600 //
let leave3 = leave2 % 60 //
let day = Math.floor(counterTime / (24 * 3600 * 1)) //
let hour = Math.floor(leave1 / (3600 * 1)) //
let minutes = Math.floor(leave2 / (60 * 1)) //
let seconds = Math.round(leave3 / 1) //
day = day >= 10 ? day : "0" + day
hour = hour >= 10 ? hour : "0" + hour
minutes = minutes >= 10 ? minutes : "0" + minutes
seconds = seconds >= 10 ? seconds : "0" + seconds
let day = Math.floor(counterTime / (24 * 3600)) //
let hour = Math.floor(leave1 / 3600) //
let minutes = Math.floor(leave2 / 60) //
let seconds = Math.round(leave3) //
day = this.timeFormat(day)
hour = this.timeFormat(hour)
minutes = this.timeFormat(minutes)
seconds = this.timeFormat(seconds)
this.day = day
this.hour = hour
this.minutes = minutes

Loading…
Cancel
Save