diff --git a/src/components/Practice/TypeArticle.vue b/src/components/Practice/TypeArticle.vue index bfa688dc..1fb5f59a 100644 --- a/src/components/Practice/TypeArticle.vue +++ b/src/components/Practice/TypeArticle.vue @@ -62,19 +62,19 @@ const practiceStore = usePracticeStore() let isPlay = $ref(false) let articleWrapperRef = $ref(null) let tabIndex = $ref(0) -let sectionIndex = $ref(1) -let sentenceIndex = $ref(2) -let wordIndex = $ref(4) +let sectionIndex = $ref(0) +let sentenceIndex = $ref(0) +let wordIndex = $ref(0) let stringIndex = $ref(0) let input = $ref('') let wrong = $ref('') let isSpace = $ref(false) let isDictation = $ref(true) -let isTranslate = $ref(false) +let showTranslate = $ref(true) let showFullWord = $ref(false) let hoverIndex = $ref({ - sectionIndex: 0, - sentenceIndex: 0, + sectionIndex: -1, + sentenceIndex: -1, }) let wordData = $ref({ @@ -122,7 +122,7 @@ onMounted(() => { }) function calcTranslateLocation() { - if (!isTranslate) return + if (!showTranslate) return nextTick(() => { setTimeout(() => { let articleRect = articleWrapperRef.getBoundingClientRect() @@ -232,7 +232,11 @@ function onKeyDown(e: KeyboardEvent) { //如果当前词没有index,说明这个词完了,下一个是空格 if (!currentWord.name[stringIndex]) { input = wrong = '' - isSpace = true + if (currentWord.nextSpace){ + isSpace = true + }else { + + } //但如果当前句子也没有index+1,并且当前段也没sentenceIndex+1,说明本段完了,不需要打空格,直接跳到下一段吧 if (!currentSentence.words[wordIndex + 1] && !currentSection[sentenceIndex + 1]) { wordIndex = sentenceIndex = stringIndex = 0 @@ -300,12 +304,12 @@ function onKeyDown(e: KeyboardEvent) { } } } - // console.log( - // 'sectionIndex', sectionIndex, - // 'sentenceIndex', sentenceIndex, - // 'wordIndex', wordIndex, - // 'index', index, - // ) + console.log( + 'sectionIndex', sectionIndex, + 'sentenceIndex', sentenceIndex, + 'wordIndex', wordIndex, + 'stringIndex', stringIndex, + ) e.preventDefault() } @@ -372,49 +376,49 @@ function otherWord(word: ArticleWord, i: number, i2: number, i3: number) {
-
+
- - - - {{ input }} - {{ wrong }} - {{ currentWordInput(word, indexI, indexJ) }} - {{ currentWordEnd(word, indexI, indexJ,) }} - - {{ otherWord(word, indexI, indexJ, indexW) }} -   - - + + + + {{ input }} + {{ wrong }} + {{ currentWordInput(word, indexI, indexJ) }} + {{ currentWordEnd(word, indexI, indexJ,) }} + + {{ otherWord(word, indexI, indexJ, indexW) }} +   + +
diff --git a/src/components/Toolbar/Toolbar.vue b/src/components/Toolbar/Toolbar.vue index c096584c..ef6d6d75 100644 --- a/src/components/Toolbar/Toolbar.vue +++ b/src/components/Toolbar/Toolbar.vue @@ -145,7 +145,7 @@ header { box-sizing: border-box; transition: all .3s; gap: 10rem; - opacity: 0; + //opacity: 0; .info { font-size: 16rem;