From b42b83714755ee8b10d20f9fcab95cf57ecddeb9 Mon Sep 17 00:00:00 2001 From: Zyronon Date: Thu, 4 Dec 2025 20:04:46 +0800 Subject: [PATCH] wip --- index.html | 139 ++++++++++++------ src/assets/css/style.scss | 2 +- src/components/Book.vue | 6 +- src/components/ChannelIcons.vue | 2 +- src/components/SettingDialog.vue | 2 +- src/hooks/export.ts | 16 +- src/pages/setting/Setting.vue | 57 ++++--- src/pages/word/PracticeWords.vue | 8 +- src/pages/word/WordsPage.vue | 13 +- src/pages/word/components/Footer.vue | 13 +- .../word/components/PracticeSettingDialog.vue | 65 ++++---- src/pages/word/components/TypeWord.vue | 13 +- src/stores/base.ts | 12 +- 13 files changed, 218 insertions(+), 130 deletions(-) diff --git a/index.html b/index.html index 85d14f7f..d1c1ca4c 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,6 @@ - - - Type Words 官网 - 词文记 | 单词跟打 · 文章跟打 + + + + + + diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index e4368b6b..f591b53f 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -461,7 +461,7 @@ a { .book { @extend .anim; @apply p-3 rounded-md relative cursor-pointer bg-third hover:bg-card-active flex flex-col justify-between shrink-0; - $w: 6rem; + $w: 7rem; width: $w; height: calc($w * 1.4); } diff --git a/src/components/Book.vue b/src/components/Book.vue index e036d7ec..193e6681 100644 --- a/src/components/Book.vue +++ b/src/components/Book.vue @@ -21,13 +21,11 @@ defineEmits<{ }>() const progress = $computed(() => { - if (props.item?.complete) return 100 return Number(((props.item?.lastLearnIndex / props.item?.length) * 100).toFixed()) }) const studyProgress = $computed(() => { if (!props.showProgress) return - if (props.item.complete) return props.item?.length + '/' return props.item?.lastLearnIndex ? props.item?.lastLearnIndex + '/' : '' }) @@ -41,14 +39,14 @@ const studyProgress = $computed(() => {
{{ studyProgress }}{{ item?.length }}{{ quantifier }}
-
+ class="absolute left-3 bottom-3 z-2"/>
自定义
更新中
diff --git a/src/components/ChannelIcons.vue b/src/components/ChannelIcons.vue index 2b22124c..03351011 100644 --- a/src/components/ChannelIcons.vue +++ b/src/components/ChannelIcons.vue @@ -189,7 +189,7 @@ const sentence = $computed(() => {
- 我在 {{ APP_NAME }} 学习了 {{ studyStats.time }} + 我学习了{{ studyStats.time }} {{ baseStore.sdict.name }}
diff --git a/src/components/SettingDialog.vue b/src/components/SettingDialog.vue index 3c79a23c..7f23d95d 100644 --- a/src/components/SettingDialog.vue +++ b/src/components/SettingDialog.vue @@ -216,7 +216,7 @@ const simpleWords = $computed({
diff --git a/src/hooks/export.ts b/src/hooks/export.ts index 7ecc7d48..a681ceef 100644 --- a/src/hooks/export.ts +++ b/src/hooks/export.ts @@ -1,4 +1,4 @@ -import { loadJsLib, shakeCommonDict } from "@/utils"; +import {loadJsLib, shakeCommonDict} from "@/utils"; import { APP_NAME, APP_VERSION, @@ -10,13 +10,13 @@ import { SAVE_DICT_KEY, SAVE_SETTING_KEY } from "@/config/env.ts"; -import { get } from "idb-keyval"; -import { saveAs } from "file-saver"; +import {get} from "idb-keyval"; +import {saveAs} from "file-saver"; import dayjs from "dayjs"; import Toast from "@/components/base/toast/Toast.ts"; -import { useBaseStore } from "@/stores/base.ts"; -import { useSettingStore } from "@/stores/setting.ts"; -import { ref } from "vue"; +import {useBaseStore} from "@/stores/base.ts"; +import {useSettingStore} from "@/stores/setting.ts"; +import {ref} from "vue"; export function useExport() { const store = useBaseStore() @@ -24,7 +24,7 @@ export function useExport() { let loading = ref(false) - async function exportData(notice = '导出成功!') { + async function exportData(notice = '导出成功!', fileName = `${APP_NAME}-User-Data-${dayjs().format('YYYY-MM-DD HH-mm-ss')}.zip`) { if (loading.value) return loading.value = true try { @@ -77,7 +77,7 @@ export function useExport() { mp3.file(rec.id + ".mp3", rec.file); } let content = await zip.generateAsync({type: "blob"}) - saveAs(content, `${APP_NAME}-User-Data-${dayjs().format('YYYY-MM-DD HH-mm-ss')}.zip`); + saveAs(content, fileName); notice && Toast.success(notice) return content } catch (e) { diff --git a/src/pages/setting/Setting.vue b/src/pages/setting/Setting.vue index 7d8c1332..6fe5a3c7 100644 --- a/src/pages/setting/Setting.vue +++ b/src/pages/setting/Setting.vue @@ -1,14 +1,21 @@