pdf 倒计时优化

This commit is contained in:
binbin_pan 2024-09-11 14:03:54 +08:00
parent f51b72051e
commit 4faff9db61
2 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -33,7 +33,7 @@ export default {
console.log('🚀 ~ onLoad ~ surplusTime:', this.surplusTime)
setTimeout(() => {
this.countDown()
}, 1300)
}, 1000)
} else {
this.surplusTime = 0
// -