diff --git a/libs.js b/libs.js index 81f83f2..4e9de30 100644 --- a/libs.js +++ b/libs.js @@ -62,8 +62,12 @@ const pageOutTime = (timestamp) => { diff -= minutes * (1000 * 60); const seconds = Math.floor(diff / 1000); + const hoursPadded = String(hours).padStart(2, "0"); + const minutesPadded = String(minutes).padStart(2, "0"); + const secondsPadded = String(seconds).padStart(2, "0"); + // 返回结果数组 - return [hours, minutes, seconds]; + return [hoursPadded, minutesPadded, secondsPadded]; } } }; diff --git a/packkey/bm-index.html b/packkey/bm-index.html index 8ab09f4..cb18c88 100644 --- a/packkey/bm-index.html +++ b/packkey/bm-index.html @@ -76,14 +76,14 @@
-
-

{{state.outTime[0]}}

时 -

{{state.outTime[1]}}

分 -

{{state.outTime[2]}}

秒 -
+
+

{{state.outTime[0]}}

时 +

{{state.outTime[1]}}

分 +

{{state.outTime[2]}}

秒 +
@@ -94,7 +94,12 @@
- +

{{state.outTime[0]}}

时 +

{{state.outTime[1]}}

分 +

{{state.outTime[2]}}

秒 +
+