From 746a51d76ca615b98bf0a2883a1a3c1a2b63d414 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 17 五月 2024 16:20:36 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/books/childHealth/view/content/components/chapter002.vue | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/books/childHealth/view/content/components/chapter002.vue b/src/books/childHealth/view/content/components/chapter002.vue index 1908f45..cec6d51 100644 --- a/src/books/childHealth/view/content/components/chapter002.vue +++ b/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> -- Gitblit v1.9.1