From 1c389a5a5c22c8d57ee79cc9ac8ed6db6c8dbadc Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 04 六月 2024 18:01:59 +0800 Subject: [PATCH] 搜素优化 --- src/books/childHealth/view/content/components/chapter010.vue | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/books/childHealth/view/content/components/chapter010.vue b/src/books/childHealth/view/content/components/chapter010.vue index e32c629..64cc7d2 100644 --- a/src/books/childHealth/view/content/components/chapter010.vue +++ b/src/books/childHealth/view/content/components/chapter010.vue @@ -1353,7 +1353,7 @@ <script> import examinations from "@/components/examinations/index.vue"; -import getResourcePath from "@/assets/methods/resources"; +import {getResourcePath} from "@/assets/methods/resources"; export default { name: "chapterTen", components: { examinations }, @@ -1363,6 +1363,10 @@ }, showPageList: { type: Array, + }, + isSearch: { + type: Boolean, + default: false, }, }, data() { @@ -1426,17 +1430,19 @@ }; }, async mounted() { - const localData = localStorage.getItem("chapterTenData"); - if (localData) { - this.chapterTenData = JSON.parse(localData); - } - window.timerTen = setInterval(() => { - this.saveTime--; - if (this.saveTime == 0) { - this.saveChapterOneData(); + if(!this.isSearch) { + const localData = localStorage.getItem("chapterTenData"); + if (localData) { + this.chapterTenData = JSON.parse(localData); } - }, 1000); - this.getVideoPath(); + window.timerTen = setInterval(() => { + this.saveTime--; + if (this.saveTime == 0) { + this.saveChapterOneData(); + } + }, 1000); + this.getVideoPath(); + } }, unmounted() { if (window.timerTen) { @@ -1465,9 +1471,9 @@ JSON.stringify(this.chapterTenData) ); }, - getVideoPath() { - this.$data.pathOne = getResourcePath("3f507f73eb9d8c2af4dfcfb032ae696e"); - this.$data.pathTwo = getResourcePath("93d4edcc8ef4f947ebfb0cee38ccaa71"); + async getVideoPath() { + this.$data.pathOne = await getResourcePath("3f507f73eb9d8c2af4dfcfb032ae696e"); + this.$data.pathTwo = await getResourcePath("93d4edcc8ef4f947ebfb0cee38ccaa71"); }, }, }; -- Gitblit v1.9.1