diff --git a/src/hooks/dict.ts b/src/hooks/dict.ts index 8c388236..668e54e7 100644 --- a/src/hooks/dict.ts +++ b/src/hooks/dict.ts @@ -25,7 +25,7 @@ export function useWordOptions() { } function isWordSimple(val: Word) { - return !!store.simple.words.find(v => v.word.toLowerCase() === val.word.toLowerCase()) + return !!store.known.words.find(v => v.word.toLowerCase() === val.word.toLowerCase()) } function toggleWordSimple(val: Word) { @@ -110,7 +110,7 @@ export function getCurrentStudyWord() { // console.time() const store = useBaseStore() let data = {new: [], review: [], write: []} - let dict = store.currentStudyWordDict; + let dict = store.sdict; if (dict.words?.length) { for (let i = dict.lastLearnIndex; i < dict.words.length; i++) { if (data.new.length >= dict.perDayStudyNumber) break diff --git a/src/hooks/sound.ts b/src/hooks/sound.ts index 00fda8b1..4c57157c 100644 --- a/src/hooks/sound.ts +++ b/src/hooks/sound.ts @@ -92,11 +92,9 @@ export function usePlayWordAudio() { const audio = $ref(new Audio()) function playAudio(word: string) { - let url = '' + let url = `${PronunciationApi}${word}&type=2` if (settingStore.wordSoundType === 'uk') { url = `${PronunciationApi}${word}&type=1` - } else if (settingStore.wordSoundType === 'us') { - url = `${PronunciationApi}${word}&type=2` } audio.src = url audio.volume = settingStore.wordSoundVolume / 100 diff --git a/src/pages/mobile/practice/practice-word/index.vue b/src/pages/mobile/practice/practice-word/index.vue index b2b414b2..82110995 100644 --- a/src/pages/mobile/practice/practice-word/index.vue +++ b/src/pages/mobile/practice/practice-word/index.vue @@ -12,8 +12,6 @@ import {useSettingStore} from "@/stores/setting.ts"; import {syncMyDictList} from "@/hooks/dict.ts"; const store = useBaseStore() -const runtimeStore = useRuntimeStore() -const settingStore = useSettingStore() let wordData = $ref({ words: [], @@ -21,11 +19,7 @@ let wordData = $ref({ }) function getCurrentPractice() { - if (store.chapter.length) { - wordData.index = 0 - wordData.words = cloneDeep(store.chapter) - emitter.emit(EventKey.resetWord) - } + } function sort(list: Word[]) { @@ -66,4 +60,4 @@ defineExpose({getCurrentPractice}) flex: 1; display: flex; } - \ No newline at end of file + diff --git a/src/pages/pc/components/Panel.vue b/src/pages/pc/components/Panel.vue index 86f58a4f..6c3ab5f7 100644 --- a/src/pages/pc/components/Panel.vue +++ b/src/pages/pc/components/Panel.vue @@ -82,7 +82,7 @@ function changeCollect() {
当前
-
{{ store.collect.name }}
+
{{ store.collectWord.name }}
{{ store.known.name }}
{{ store.wrong.name }}
diff --git a/src/pages/pc/word/DictDetail.vue b/src/pages/pc/word/DictDetail.vue index f1bc75d5..f2269ad0 100644 --- a/src/pages/pc/word/DictDetail.vue +++ b/src/pages/pc/word/DictDetail.vue @@ -18,6 +18,7 @@ import {useRoute, useRouter} from "vue-router"; import {useBaseStore} from "@/stores/base.ts"; import EditBook from "@/pages/pc/article/components/EditBook.vue"; import {_getDictDataByUrl, _nextTick} from "@/utils"; +import {emitter, EventKey} from "@/utils/eventBus.ts"; const runtimeStore = useRuntimeStore() const base = useBaseStore() @@ -292,18 +293,26 @@ function formClose() { } async function addMyStudyList() { + + //把其他的词典的单词数据都删掉,全保存在内存里太卡了 base.word.bookList.slice(3).map(v => { if (!v.custom) { v.words = [] } }) let rIndex = base.word.bookList.findIndex(v => v.name === runtimeStore.editDict.name) + if (runtimeStore.editDict.words.length < runtimeStore.editDict.perDayStudyNumber) { + runtimeStore.editDict.perDayStudyNumber = runtimeStore.editDict.words.length + } if (rIndex > -1) { base.word.studyIndex = rIndex + base.word.bookList[base.word.studyIndex].words = runtimeStore.editDict.words + base.word.bookList[base.word.studyIndex].perDayStudyNumber = runtimeStore.editDict.perDayStudyNumber } else { base.word.bookList.push(runtimeStore.editDict) base.word.studyIndex = base.word.bookList.length - 1 } + router.back() } diff --git a/src/pages/pc/word/Statistics.vue b/src/pages/pc/word/Statistics.vue index 73a5b773..dd421dc5 100644 --- a/src/pages/pc/word/Statistics.vue +++ b/src/pages/pc/word/Statistics.vue @@ -1,8 +1,6 @@