unknown
2024-06-05 c3a97e9da90ab1a34f766acd35944d295cc5a6bf
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");
    },
  },
};