From 7944d624d5adf492a4a5ead068b2a88c707e2388 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 07 六月 2024 10:49:55 +0800
Subject: [PATCH] 学前儿童保存优化

---
 src/books/childHealth/view/content/components/chapter005.vue |   30 +++++++++---------------------
 1 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/src/books/childHealth/view/content/components/chapter005.vue b/src/books/childHealth/view/content/components/chapter005.vue
index d142fd7..690fcda 100644
--- a/src/books/childHealth/view/content/components/chapter005.vue
+++ b/src/books/childHealth/view/content/components/chapter005.vue
@@ -2734,6 +2734,10 @@
     showPageList: {
       type: Array,
     },
+    isSearch: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -2837,22 +2841,7 @@
     if (localData) {
       this.chapterFiveData = JSON.parse(localData);
     }
-    window.timerFive = setInterval(() => {
-      this.saveTime--;
-      if (this.saveTime == 0) {
-        this.saveChapterOneData();
-      }
-    }, 1000);
     this.getVideoPath();
-  },
-  unmounted() {
-    if (window.timerFive) {
-      clearInterval(window.timerFive);
-    }
-    localStorage.setItem(
-      "chapterFiveData",
-      JSON.stringify(this.chapterFiveData)
-    );
   },
   methods: {
     changeResources(type) {
@@ -2869,19 +2858,18 @@
       }
     },
     saveChapterOneData() {
-      this.saveTime = 20;
       localStorage.setItem(
         "chapterFiveData",
         JSON.stringify(this.chapterFiveData)
       );
     },
-    getVideoPath() {
-      this.$data.pathOne = getResourcePath("5698398be3f5c7fdb247218b2a687257");
-      this.$data.pathTwo = getResourcePath("5905673b09837c74953dd11fcb27d123");
-      this.$data.pathThree = getResourcePath(
+    async getVideoPath() {
+      this.$data.pathOne = await getResourcePath("5698398be3f5c7fdb247218b2a687257");
+      this.$data.pathTwo = await getResourcePath("5905673b09837c74953dd11fcb27d123");
+      this.$data.pathThree = await getResourcePath(
         "1f768157227c193ed5c11f972f66e692"
       );
-      this.$data.pathFour = getResourcePath("4f446d88ec1ed081a172b7130dce896b");
+      this.$data.pathFour = await getResourcePath("4f446d88ec1ed081a172b7130dce896b");
     },
   },
 };

--
Gitblit v1.9.1