diff --git a/Note.md b/Note.md index eac4eee1..ab9c7d0c 100644 --- a/Note.md +++ b/Note.md @@ -53,3 +53,4 @@ http://enpuz.com/ 语法分析工具 背单词页面div,位置应该恒定,不应该随翻译内容变动而跳动 +点击句子播放的音乐,需要可暂停 diff --git a/components.d.ts b/components.d.ts index 14fd4f32..b97c010a 100644 --- a/components.d.ts +++ b/components.d.ts @@ -40,12 +40,10 @@ declare module 'vue' { Fireworks: typeof import('./src/components/Fireworks.vue')['default'] Footer: typeof import('./src/components/Practice/Footer.vue')['default'] IconWrapper: typeof import('./src/components/IconWrapper.vue')['default'] - Index: typeof import('./src/components/Practice/PracticeArticle/Index.vue')['default'] Input: typeof import('./src/components/Input.vue')['default'] List: typeof import('./src/components/List.vue')['default'] MiniModal: typeof import('./src/components/MiniModal.vue')['default'] Modal: typeof import('./src/components/Modal/Modal.vue')['default'] - Panel: typeof import('./src/components/Practice/TypingArticle/Panel.vue')['default'] PopConfirm: typeof import('./src/components/PopConfirm.vue')['default'] Practice: typeof import('./src/components/Practice/Practice.vue')['default'] PracticeArticle: typeof import('./src/components/Practice/PracticeArticle/PracticeArticle.vue')['default'] @@ -57,10 +55,6 @@ declare module 'vue' { Toolbar: typeof import('./src/components/Toolbar/Toolbar.vue')['default'] Tooltip: typeof import('./src/components/Tooltip.vue')['default'] TranslateSetting: typeof import('./src/components/Toolbar/TranslateSetting.vue')['default'] - TypeArticle: typeof import('./src/components/Practice/TypingArticle/TypeArticle.vue')['default'] - TypeWord: typeof import('./src/components/Practice/PracticeWord/TypeWord.vue')['default'] - Typing: typeof import('./src/components/Practice/TypingArticle/Typing.vue')['default'] - TypingArti: typeof import('./src/components/Practice/TypingArticle/TypingArti.vue')['default'] TypingArticle: typeof import('./src/components/Practice/PracticeArticle/TypingArticle.vue')['default'] TypingWord: typeof import('./src/components/Practice/PracticeWord/TypingWord.vue')['default'] VolumeIcon: typeof import('./src/components/VolumeIcon.vue')['default'] diff --git a/src/components/Practice/Footer.vue b/src/components/Practice/Footer.vue index b7f6d523..38e7f910 100644 --- a/src/components/Practice/Footer.vue +++ b/src/components/Practice/Footer.vue @@ -86,7 +86,7 @@ onUnmounted(() => { margin-bottom: 10rem; transition: all .3s; position: relative; - margin-top: 30rem; + margin-top: 20rem; &.hide { margin-bottom: -90rem; diff --git a/src/components/Practice/Practice.vue b/src/components/Practice/Practice.vue index ddd014d9..16509e41 100644 --- a/src/components/Practice/Practice.vue +++ b/src/components/Practice/Practice.vue @@ -4,8 +4,6 @@ import Toolbar from "@/components/Toolbar/Toolbar.vue" import {onMounted, watch} from "vue"; import {usePracticeStore} from "@/stores/practice.ts"; import Footer from "@/components/Practice/Footer.vue"; -import TypeWord from "@/components/Practice/TypeWord.vue"; -import TypeArticle from "@/components/Practice/TypeArticle.vue"; import {useBaseStore} from "@/stores/base.ts"; import {$ref} from "vue/macros"; import Statistics from "@/components/Practice/Statistics.vue"; @@ -17,14 +15,13 @@ import {useRuntimeStore} from "@/stores/runtime.ts"; import {renewSectionTexts, renewSectionTranslates} from "@/hooks/translate.ts"; import {MessageBox} from "@/utils/MessageBox.tsx"; import EditSingleArticleModal from "@/components/Article/EditSingleArticleModal.vue"; +import PracticeArticle from "@/components/Practice/PracticeArticle/PracticeArticle.vue"; const practiceStore = usePracticeStore() const store = useBaseStore() const settingStore = useSettingStore() const runtimeStore = useRuntimeStore() -let showEditArticle = $ref(false) -let editArticle = $ref
(cloneDeep(DefaultArticle)) watch(practiceStore, () => { if (practiceStore.inputWordNumber < 1) { @@ -66,75 +63,9 @@ watch([ function getCurrentPractice() { // console.log('store.currentDict',store.currentDict) - if (store.isArticle) { - // return - let currentArticle = store.currentDict.articles[store.currentDict.chapterIndex] - let tempArticle = {...DefaultArticle, ...currentArticle} - console.log('article', tempArticle) - if (tempArticle.sections.length) { - articleData.article = tempArticle - } else { - if (tempArticle.useTranslateType === TranslateType.none) { - renewSectionTexts(tempArticle) - articleData.article = tempArticle - } else { - if (tempArticle.useTranslateType === TranslateType.custom) { - if (tempArticle.textCustomTranslate.trim()) { - if (tempArticle.textCustomTranslateIsFormat) { - renewSectionTexts(tempArticle) - renewSectionTranslates(tempArticle, tempArticle.textCustomTranslate) - articleData.article = tempArticle - } else { - //说明有本地翻译,但是没格式化成一行一行的 - MessageBox.confirm('检测到存在本地翻译,但未格式化,是否进行编辑?', - '提示', - () => { - editArticle = tempArticle - showEditArticle = true - }, - () => { - renewSectionTexts(tempArticle) - tempArticle.useTranslateType = TranslateType.none - store.currentDict.articles[store.currentDict.chapterIndex] = articleData.article = tempArticle - }, - { - confirmButtonText: '去编辑', - cancelButtonText: '不需要翻译', - }) - } - } else { - //没有本地翻译 - MessageBox.confirm( - '没有本地翻译,是否进行编辑?', - '提示', - () => { - editArticle = tempArticle - showEditArticle = true - }, - () => { - renewSectionTexts(tempArticle) - tempArticle.useTranslateType = TranslateType.none - store.currentDict.articles[store.currentDict.chapterIndex] = articleData.article = tempArticle - }, - { - confirmButtonText: '去编辑', - cancelButtonText: '不需要翻译', - }) - } - } - - if (tempArticle.useTranslateType === TranslateType.network) { - renewSectionTexts(tempArticle) - renewSectionTranslates(tempArticle, tempArticle.textNetworkTranslate) - store.currentDict.articles[store.currentDict.chapterIndex] = articleData.article = tempArticle - } - } - } - } else { - wordData.words = cloneDeep(store.chapter) - wordData.index = 0 - console.log('wordData', wordData) - } + wordData.words = cloneDeep(store.chapter) + wordData.index = 0 + console.log('wordData', wordData) } onMounted(() => { @@ -161,18 +92,6 @@ function next() { // repeat() } -function saveArticle(val: Article) { - console.log('saveArticle', val) - showEditArticle = false - // articleData.article = cloneDeep(store.currentDict.articles[store.currentDict.chapterIndex]) - store.currentDict.articles[store.currentDict.chapterIndex] = articleData.article = val -} - -function edit(val: Article) { - editArticle = val - showEditArticle = true -} - function test() { MessageBox.confirm( '2您选择了“本地翻译”,但译文内容却为空白,是否修改为“不需要翻译”并保存?', @@ -189,21 +108,7 @@ function test() {
- - +
- \ No newline at end of file diff --git a/src/components/Practice/PracticeArticle/TypingArticle.vue b/src/components/Practice/PracticeArticle/TypingArticle.vue index 4fa3c350..711c9241 100644 --- a/src/components/Practice/PracticeArticle/TypingArticle.vue +++ b/src/components/Practice/PracticeArticle/TypingArticle.vue @@ -1,10 +1,9 @@