Commit 20b42351 authored by yaya's avatar yaya

feat: 时间展示优化

parent e56123a3
...@@ -87,13 +87,14 @@ export default { ...@@ -87,13 +87,14 @@ export default {
if (mss > 0) { if (mss > 0) {
const hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) // 得到小时 const hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) // 得到小时
const minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)) // 得到分钟数 const minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)) // 得到分钟数
const str = hours < 10 ? ('0' + hours) : hours
// 获取分钟 // 获取分钟
const str1 = minutes < 10 ? ('0' + minutes) : minutes const str1 = minutes < 10 ? ('0' + minutes) : minutes
// 得到秒数 // 得到秒数
const seconds = parseInt((mss % (1000 * 60)) / 1000) const seconds = parseInt((mss % (1000 * 60)) / 1000)
const str2 = seconds < 10 ? ('0' + seconds) : seconds const str2 = seconds < 10 ? ('0' + seconds) : seconds
return '剩余' + hours + ':' + str1 + ':' + str2 return '剩余' + str + ':' + str1 + ':' + str2
} else { } else {
return '已超时' return '已超时'
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment