From 0f8b867f01f952cae2735d0faeb1308967670022 Mon Sep 17 00:00:00 2001 From: zyronon Date: Wed, 30 Aug 2023 01:08:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Modal/Statistics.vue | 14 +++---- src/components/Ring.vue | 18 +++++++-- src/components/Side.vue | 63 +++++++++++++++++++++-------- src/components/Type.vue | 8 +++- src/stores/base.ts | 46 ++++++++++++++------- 5 files changed, 104 insertions(+), 45 deletions(-) diff --git a/src/components/Modal/Statistics.vue b/src/components/Modal/Statistics.vue index 7ffae0cd..fc55268d 100644 --- a/src/components/Modal/Statistics.vue +++ b/src/components/Modal/Statistics.vue @@ -18,13 +18,7 @@ let currentStat = reactive(cloneDeep(DefaultStatistics)) onMounted(() => { emitter.on(EventKey.openStatModal, () => { statModalIsOpen = true - currentStat = cloneDeep(store.current.statistics) - currentStat.endDate = Date.now() - currentStat.spend = Date.now() - currentStat.startDate - currentStat.wrongWordNumber = store.current.originWrongWords.length - currentStat.correctRate = 100 - Math.trunc((currentStat.wrongWordNumber / currentStat.wordNumber) * 100) - console.log(cloneDeep(currentStat)) - store.currentDict.statistics.push(currentStat) + currentStat = store.saveStatistics() }) }) @@ -35,11 +29,13 @@ function write() { //TODO 需要判断是否已忽略 function repeat() { + console.log(store.chapter) store.setCurrentWord(store.chapter, true) statModalIsOpen = false emitter.emit(EventKey.resetWord) } +//TODO 能否下一章 function next() { store.currentDict.chapterIndex++ repeat() @@ -111,7 +107,7 @@ function next() {