From fe02206b64c4997094fd8371f6b5d439c3f2688f Mon Sep 17 00:00:00 2001 From: unknown <qq1940665526@163.com> Date: 星期四, 06 六月 2024 11:56:44 +0800 Subject: [PATCH] 优化 --- src/books/childHealth/view/content/components/chapter009.vue | 44 +++++++++++++++++++++++++------------------- 1 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/books/childHealth/view/content/components/chapter009.vue b/src/books/childHealth/view/content/components/chapter009.vue index ce93500..29af446 100644 --- a/src/books/childHealth/view/content/components/chapter009.vue +++ b/src/books/childHealth/view/content/components/chapter009.vue @@ -1735,7 +1735,7 @@ <script> import examinations from "@/components/examinations/index.vue"; -import getResourcePath from "@/assets/methods/resources"; +import {getResourcePath} from "@/assets/methods/resources"; export default { name: "chapterNine", components: { examinations }, @@ -1745,6 +1745,10 @@ }, showPageList: { type: Array, + }, + isSearch: { + type: Boolean, + default: false, }, }, data() { @@ -1830,17 +1834,19 @@ }; }, async mounted() { - const localData = localStorage.getItem("chapterNineData"); - if (localData) { - this.chapterNineData = JSON.parse(localData); - } - window.timerNine = setInterval(() => { - this.saveTime--; - if (this.saveTime == 0) { - this.saveChapterOneData(); + if(!this.isSearch) { + const localData = localStorage.getItem("chapterNineData"); + if (localData) { + this.chapterNineData = JSON.parse(localData); } - }, 1000); - this.getVideoPath(); + window.timerNine = setInterval(() => { + this.saveTime--; + if (this.saveTime == 0) { + this.saveChapterOneData(); + } + }, 1000); + this.getVideoPath(); + } }, unmounted() { if (window.timerNine) { @@ -1872,16 +1878,16 @@ this.$data.learnTableFive = !this.$data.learnTableFive; } }, - getVideoPath() { - this.$data.pathOne = getResourcePath("730ab5395d1b5b5c87d7422cc6540f35"); - this.$data.pathTwo = getResourcePath("e3c6884dc80cf947e3a38c5595d474ad"); - this.$data.pathThree = getResourcePath( + async getVideoPath() { + this.$data.pathOne = await getResourcePath("730ab5395d1b5b5c87d7422cc6540f35"); + this.$data.pathTwo = await getResourcePath("e3c6884dc80cf947e3a38c5595d474ad"); + this.$data.pathThree = await getResourcePath( "bdaec679118721e0623d62ac3031288e" ); - this.$data.pathFour = getResourcePath("c61f14623b01adaa326d18f2a19b822b"); - this.$data.pathFive = getResourcePath("c469389f516c81f13e4d0440bd9ec87e"); - this.$data.pathSix = getResourcePath("f8d747892eb8af7ed16bcb71967d414f"); - this.$data.pathSeven = getResourcePath( + this.$data.pathFour = await getResourcePath("c61f14623b01adaa326d18f2a19b822b"); + this.$data.pathFive = await getResourcePath("c469389f516c81f13e4d0440bd9ec87e"); + this.$data.pathSix = await getResourcePath("f8d747892eb8af7ed16bcb71967d414f"); + this.$data.pathSeven = await getResourcePath( "960e9aa17b48e900b08cde6e44b774f3" ); }, -- Gitblit v1.9.1