闫增涛
2024-05-17 6366435872a3729151705b992758c9eaadff1cd6
src/books/childHealth/view/content/components/chapter002.vue
@@ -530,7 +530,7 @@
              <textarea
                cols="30"
                rows="4"
                v-model="chapterTwoData.learnTableTwo.qEvelen"
                v-model="chapterTwoData.learnTableTwo.qEleven"
                placeholder="请输入内容"
                maxlength="300"
                class="w100 ta-br textarea-text"
@@ -1301,7 +1301,7 @@
          qEight: "",
          qNine: "",
          qTen: "",
          qEvelen: "",
          qEleven: "",
        },
        learnTableThree: {
          qOne: "",
@@ -1351,10 +1351,26 @@
    };
  },
  async mounted() {
    const localData = localStorage.getItem('chapterTwoData')
    if(localData) {
      this.chapterTwoData = JSON.parse(localData)
    }
    window.timerOne = setInterval(() => {
      this.saveTime--
      if(this.saveTime == 0) {
        this.saveChapterOneData()
      }
    },1000)
    this.$data.questionData = await getQuestionData('2',testData[2]);
    this.$data.pathOne = getResourcePath("e2b2b610e8b77c82bad7cf94c7986646");
    this.$data.pathTwo = getResourcePath("b11b51863da2a4e7e21c73358fa96c1e");
    this.$data.pathThree = getResourcePath("67cf97bd8295dc3aeb46982c574df8d0");
  },
  unmounted() {
    if(window.timerTwo) {
      clearInterval(window.timerTwo)
    }
    localStorage.setItem('chapterTwoData',JSON.stringify(this.chapterTwoData))
  },
  methods: {
    changeResources(type) {
@@ -1368,6 +1384,11 @@
        this.$data.videoState = !this.$data.videoState;
      }
    },
    saveChapterOneData() {
      this.saveTime = 20
      console.log(this.chapterTwoData);
      localStorage.setItem('chapterTwoData',JSON.stringify(this.chapterTwoData))
    }
  },
};
</script>