From f6b96bacf3c5d93c5f5320d94c17ed3e7fd447fa Mon Sep 17 00:00:00 2001 From: "jialong.yu" Date: Tue, 28 Dec 2021 10:13:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=92=E8=AE=A1=E6=97=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TestPanel.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index afda6f4..2abb299 100644 --- a/src/components/TestPanel.vue +++ b/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