From 135ae13b6f20cde721f40850b56c76525d417202 Mon Sep 17 00:00:00 2001 From: Zyronon Date: Mon, 17 Nov 2025 23:44:45 +0800 Subject: [PATCH 01/14] save --- public/migrate.html | 7 +- public/static-home.html | 130 ++++++++++++++++++------- src/components/list/ArticleList.vue | 7 +- src/components/list/BaseList.vue | 6 +- src/pages/article/PracticeArticles.vue | 24 +++-- 5 files changed, 118 insertions(+), 56 deletions(-) diff --git a/public/migrate.html b/public/migrate.html index 6da68ad4..0db735d0 100644 --- a/public/migrate.html +++ b/public/migrate.html @@ -8,14 +8,14 @@ diff --git a/src/components/list/ArticleList.vue b/src/components/list/ArticleList.vue index a4491444..8591efa9 100644 --- a/src/components/list/ArticleList.vue +++ b/src/components/list/ArticleList.vue @@ -7,13 +7,11 @@ import BaseInput from "@/components/base/BaseInput.vue"; interface IProps { list: Article[]; showTranslate?: boolean; - activeId: string | number; } const props = withDefaults(defineProps(), { list: () => [] as Article[], showTranslate: true, - activeId: "" }) const emit = defineEmits<{ @@ -79,7 +77,10 @@ defineExpose({ scrollToBottom, scrollToItem }) - + diff --git a/src/components/list/BaseList.vue b/src/components/list/BaseList.vue index 85c6e2de..b3b86186 100644 --- a/src/components/list/BaseList.vue +++ b/src/components/list/BaseList.vue @@ -5,13 +5,13 @@ import { nextTick, watch } from 'vue' const props = withDefaults(defineProps<{ list?: any[], activeIndex?: number, - activeId?: number, + activeId?: number | string, isActive?: boolean static?: boolean }>(), { list: [], activeIndex: -1, - activeId: null, + activeId: '', isActive: false, static: true }) @@ -94,7 +94,7 @@ function scrollToItem(index: number) { function itemIsActive(item: any, index: number) { return props.activeId ? - props.activeId === item.id + props.activeId == item.id : props.activeIndex === index } diff --git a/src/pages/article/PracticeArticles.vue b/src/pages/article/PracticeArticles.vue index 7de7e146..1b062627 100644 --- a/src/pages/article/PracticeArticles.vue +++ b/src/pages/article/PracticeArticles.vue @@ -42,7 +42,7 @@ const store = useBaseStore() const runtimeStore = useRuntimeStore() const settingStore = useSettingStore() const statStore = usePracticeStore() -const { toggleTheme } = useTheme() +const {toggleTheme} = useTheme() let articleData = $ref({ list: [], @@ -132,6 +132,7 @@ async function init() { router.push('/articles') } } + const initAudio = () => { _nextTick(() => { audioRef.volume = settingStore.articleSoundVolume / 100 @@ -154,11 +155,11 @@ const handleSpeedUpdate = (speed: number) => { watch(() => store.load, (n) => { if (n && loading) init() -}, { immediate: true }) +}, {immediate: true}) watch(() => settingStore.$state, (n) => { initAudio() -}, { immediate: true, deep: true }) +}, {immediate: true, deep: true}) onMounted(() => { if (store.sbook?.articles?.length) { @@ -190,9 +191,9 @@ function savePracticeData(init = true, regenerate = true) { let data = obj.val //如果全是0,说明未进行练习,直接重置 if ( - data.practiceData.sectionIndex === 0 && - data.practiceData.sentenceIndex === 0 && - data.practiceData.wordIndex === 0 + data.practiceData.sectionIndex === 0 && + data.practiceData.sentenceIndex === 0 && + data.practiceData.wordIndex === 0 ) { throw new Error() } @@ -262,6 +263,10 @@ function setArticle(val: Article) { }) } +watch(() => articleData.article.id, n => { + console.log('articleData.article.id', n) +}) + async function complete() { clearInterval(timer) setTimeout(() => { @@ -279,7 +284,7 @@ async function complete() { } if (AppEnv.CAN_REQUEST) { - let res = await addStat({ ...data, type: 'article' }) + let res = await addStat({...data, type: 'article'}) if (!res.success) { Toast.error(res.msg) } @@ -438,7 +443,8 @@ onUnmounted(() => { timer && clearInterval(timer) }) -const { playSentenceAudio } = usePlaySentenceAudio() +const {playSentenceAudio} = usePlaySentenceAudio() + function play2(e) { _nextTick(() => { if (settingStore.articleSound || e.handle) { @@ -485,7 +491,7 @@ provide('currentPractice', currentPractice) :static="false" :show-translate="settingStore.translate" @click="changeArticle" - :active-id="articleData.article.id" + :active-id="articleData.article.id??''" :list="articleData.list "> \ No newline at end of file diff --git a/src/pages/MigrateDialog.vue b/src/pages/MigrateDialog.vue index d8c35c4b..683ce4f9 100644 --- a/src/pages/MigrateDialog.vue +++ b/src/pages/MigrateDialog.vue @@ -10,6 +10,8 @@ const Dialog = defineAsyncComponent(() => import('@/components/dialog/Dialog.vue const model = defineModel() +const emit = defineEmits<{ ok: [] }>() + async function migrateFromOldSite() { return new Promise(async (resolve, reject) => { // 旧域名地址 @@ -79,6 +81,8 @@ async function transfer() { console.log('迁移完成'); Toast.success('迁移完成') model.value = false + emit('ok') + } catch (e) { Toast.error('迁移失败:' + e) console.error('迁移失败', e); @@ -93,7 +97,7 @@ async function transfer() { 本网站已启用新域名 {{ Origin }}

- 由于浏览器安全限制,新老网站数据无法互通,需要您手动点击转移数据 + 老域名即将停用,由于浏览器安全限制,新老网站数据无法互通,需要您手动点击转移数据

Date: Tue, 18 Nov 2025 14:19:05 +0800 Subject: [PATCH 11/14] save4 --- public/migrate.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/migrate.html b/public/migrate.html index 27b34936..1ad795d4 100644 --- a/public/migrate.html +++ b/public/migrate.html @@ -47,7 +47,10 @@ const indexedDBData = {}; for (let key of keys) { - indexedDBData[key] = await db.get(key); + let res = await db.get(key); + if (res === null) { + indexedDBData[key] = res + } } return { From 8af36d93f8c1f2e023709d1655f408b1b1aa7b6b Mon Sep 17 00:00:00 2001 From: Zyronon Date: Tue, 18 Nov 2025 15:00:26 +0800 Subject: [PATCH 12/14] save4 --- public/migrate.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/migrate.html b/public/migrate.html index 1ad795d4..72bc2c29 100644 --- a/public/migrate.html +++ b/public/migrate.html @@ -48,9 +48,7 @@ const indexedDBData = {}; for (let key of keys) { let res = await db.get(key); - if (res === null) { - indexedDBData[key] = res - } + if (res) indexedDBData[key] = res } return { From ccd1586667cfd1f835f4435d92198c0efadeb61d Mon Sep 17 00:00:00 2001 From: Zyronon Date: Tue, 18 Nov 2025 15:40:50 +0800 Subject: [PATCH 13/14] update:readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3efda9c1..09f03c51 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ ### 单词练习 -- 三种输入模式:跟打 / 复习 / 默写 +- 四种输入模式:跟打 / 辨认 / 复习 / 默写 - 智能模式:记忆曲线自动计算学习单词,并通过默写加深记忆 - 自由模式:不受限制,自行规划 - 提供音标、发音(美音、英音)、例句、短语、近义词、同根词、词源、错误统计等功能 From 2a515aaf8f2be5c567cbb628e5826748e75d04c0 Mon Sep 17 00:00:00 2001 From: Zyronon Date: Tue, 18 Nov 2025 16:18:06 +0800 Subject: [PATCH 14/14] fix:#162 --- public/list/word.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/list/word.json b/public/list/word.json index d7fef4dd..d77fe020 100644 --- a/public/list/word.json +++ b/public/list/word.json @@ -1896,9 +1896,6 @@ "tags": [ "通用" ], - "words": [ - "private","fuck","add","remove" - ], "url": "GaoKaoZhenTiHeXinGaoPin.json", "length": 799, "language": "en",