From 0e8066a203f35bc4e20b64113829975c5b48252b Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期四, 06 六月 2024 17:38:56 +0800 Subject: [PATCH] 答题器保存功能优化 --- src/books/childHealth/view/content/components/chapter008.vue | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/books/childHealth/view/content/components/chapter008.vue b/src/books/childHealth/view/content/components/chapter008.vue index 33762ff..e5bd495 100644 --- a/src/books/childHealth/view/content/components/chapter008.vue +++ b/src/books/childHealth/view/content/components/chapter008.vue @@ -2406,6 +2406,10 @@ showPageList: { type: Array, }, + isSearch: { + type: Boolean, + default: false, + }, }, data() { return { @@ -2510,17 +2514,19 @@ }; }, async mounted() { - const localData = localStorage.getItem("chapterEnightData"); - if (localData) { - this.chapterEnightData = JSON.parse(localData); - } - window.timerEnight = setInterval(() => { - this.saveTime--; - if (this.saveTime == 0) { - this.saveChapterOneData(); + if(!this.isSearch) { + const localData = localStorage.getItem("chapterEnightData"); + if (localData) { + this.chapterEnightData = JSON.parse(localData); } - }, 1000); - this.getVideoPath(); + window.timerEnight = setInterval(() => { + this.saveTime--; + if (this.saveTime == 0) { + this.saveChapterOneData(); + } + }, 1000); + this.getVideoPath(); + } }, unmounted() { if (window.timerEnight) { -- Gitblit v1.9.1