pdf 倒计时优化
This commit is contained in:
parent
f51b72051e
commit
4faff9db61
|
|
@ -497,7 +497,10 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
let second = params % 60;
|
||||
let time = minute + ':' + second;
|
||||
let interval = setInterval(() => {
|
||||
if (time == 0) {
|
||||
params -= 1;
|
||||
console.log('params:',params)
|
||||
|
||||
if (params <= 0) {
|
||||
clearInterval(interval);
|
||||
document.getElementById('tip').innerText = '已完成学习';
|
||||
} else {
|
||||
|
|
@ -508,12 +511,15 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
minute -= 1;
|
||||
second = 59;
|
||||
if (minute < 10) {
|
||||
minute = '0' + minute;
|
||||
minute = String(minute).padStart(2, '0');
|
||||
}
|
||||
} else {
|
||||
second -= 1;
|
||||
if (minute < 10) {
|
||||
minute = String(minute).padStart(2, '0');
|
||||
}
|
||||
if (second < 10) {
|
||||
second = '0' + second;
|
||||
second = String(second).padStart(2, '0');
|
||||
}
|
||||
}
|
||||
time = minute + ':' + second;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export default {
|
|||
console.log('🚀 ~ onLoad ~ surplusTime:', this.surplusTime)
|
||||
setTimeout(() => {
|
||||
this.countDown()
|
||||
}, 1300)
|
||||
}, 1000)
|
||||
} else {
|
||||
this.surplusTime = 0
|
||||
// 提示-学习时长已满
|
||||
|
|
|
|||
Loading…
Reference in New Issue