From 4faff9db6100b3ef65e68a46ea6530421dc27659 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Wed, 11 Sep 2024 14:03:54 +0800 Subject: [PATCH] =?UTF-8?q?pdf=20=E5=80=92=E8=AE=A1=E6=97=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hybrid/html/web/viewer.html | 12 +++++++++--- pages/YNEduApp/learnProj/pdfStudy.vue | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hybrid/html/web/viewer.html b/hybrid/html/web/viewer.html index 61f86b0..d208332 100644 --- a/hybrid/html/web/viewer.html +++ b/hybrid/html/web/viewer.html @@ -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; diff --git a/pages/YNEduApp/learnProj/pdfStudy.vue b/pages/YNEduApp/learnProj/pdfStudy.vue index 4f3314a..fdaa579 100644 --- a/pages/YNEduApp/learnProj/pdfStudy.vue +++ b/pages/YNEduApp/learnProj/pdfStudy.vue @@ -33,7 +33,7 @@ export default { console.log('🚀 ~ onLoad ~ surplusTime:', this.surplusTime) setTimeout(() => { this.countDown() - }, 1300) + }, 1000) } else { this.surplusTime = 0 // 提示-学习时长已满