-
-
第{{ indexI + 1 }}段
+
+
第{{ indexI + 1 }}段
{{ sentence.audioPosition?.[1] ?? 0 }}s
结束
@@ -479,13 +511,14 @@ function setStartTime(val: Sentence, i: number, j: number) {
-
+
+ @click="playSentenceAudio(sentence,audioRef.el)">
@@ -506,7 +539,7 @@ function setStartTime(val: Sentence, i: number, j: number) {
翻译完成!
-
+
保存
保存并添加下一篇
@@ -525,7 +558,7 @@ function setStartTime(val: Sentence, i: number, j: number) {
教程:点击音频播放按钮,当播放到句子开始时,点击开始时间的
记录
按钮;当播放到句子结束时,点击结束时间的
记录 按钮,最后再试听是否正确
-
+
{{ editSentence.text }}
@@ -536,7 +569,7 @@ function setStartTime(val: Sentence, i: number, j: number) {
+ @click="playSentenceAudio(editSentence,sentenceAudioRef.el)">
@@ -549,13 +582,14 @@ function setStartTime(val: Sentence, i: number, j: number) {
@@ -588,8 +622,8 @@ function setStartTime(val: Sentence, i: number, j: number) {
box-sizing: border-box;
display: flex;
gap: var(--space);
- padding: var(--space);
- padding-top: .6rem;
+ padding: 0.6rem;
+ padding-left: 0;
}
.row {
@@ -607,7 +641,6 @@ function setStartTime(val: Sentence, i: number, j: number) {
.title {
font-weight: bold;
font-size: 1.4rem;
- text-align: center;
}
.article-translate {
@@ -629,7 +662,7 @@ function setStartTime(val: Sentence, i: number, j: number) {
.sentence {
display: flex;
- padding: 0.5rem 1.5rem;
+ padding: 0.5rem;
line-height: 1.2;
border-bottom: 1px solid var(--color-item-border);
@@ -663,11 +696,6 @@ function setStartTime(val: Sentence, i: number, j: number) {
font-size: 1.2rem;
color: #67C23A;
}
-
- .left {
- gap: var(--space);
- display: flex;
- }
}
}
diff --git a/src/pages/pc/article/components/TypingArticle.vue b/src/pages/pc/article/components/TypingArticle.vue
index 49da4e70..c1a3179d 100644
--- a/src/pages/pc/article/components/TypingArticle.vue
+++ b/src/pages/pc/article/components/TypingArticle.vue
@@ -196,7 +196,7 @@ function nextSentence() {
if (!currentSection[sentenceIndex]) {
sentenceIndex = 0
sectionIndex++
-
+
if (!props.article.sections[sectionIndex]) {
console.log('打完了')
isEnd = true
@@ -207,14 +207,14 @@ function nextSentence() {
} else {
emit('play', {sentence: currentSection[sentenceIndex], handle: false})
}
-
+
// 如果有新的单词,更新当前单词信息
- if (!isEnd && props.article.sections[sectionIndex] &&
- props.article.sections[sectionIndex][sentenceIndex] &&
+ if (!isEnd && props.article.sections[sectionIndex] &&
+ props.article.sections[sectionIndex][sentenceIndex] &&
props.article.sections[sectionIndex][sentenceIndex].words[wordIndex]) {
updateCurrentWordInfo(props.article.sections[sectionIndex][sentenceIndex].words[wordIndex]);
}
-
+
lockNextSentence = false
}
@@ -235,7 +235,7 @@ function onTyping(e: KeyboardEvent) {
let currentSection = props.article.sections[sectionIndex]
let currentSentence = currentSection[sentenceIndex]
let currentWord: ArticleWord = currentSentence.words[wordIndex]
-
+
// 更新当前单词信息
updateCurrentWordInfo(currentWord);
@@ -258,7 +258,7 @@ function onTyping(e: KeyboardEvent) {
if (e.code === 'Space') {
// 检查下一个单词是否存在
const hasNextWord = wordIndex + 1 < currentSentence.words.length;
-
+
// 当按下空格键时,移动到下一个单词,而不是下跳过句子,末尾跳转到下一个
if (hasNextWord) {
// 重置isSpace状态
@@ -266,19 +266,19 @@ function onTyping(e: KeyboardEvent) {
stringIndex = 0;
wordIndex++;
input = '';
-
+
emit('nextWord', currentWord);
-
+
// 获取下一个单词
currentWord = currentSentence.words[wordIndex];
-
+
if (currentWord && currentWord.word && currentWord.word[0] === ' ') {
input = ' ';
if (!currentWord.input) currentWord.input = '';
currentWord.input = input;
stringIndex = 1;
}
-
+
// 更新当前单词信息
updateCurrentWordInfo(currentWord);
} else {
@@ -300,7 +300,7 @@ function onTyping(e: KeyboardEvent) {
emit('play', {sentence: currentSection[sentenceIndex], handle: false})
}
let letter = e.key
-
+
// 如果是空格键,需要判断是作为输入还是切换单词
if (letter === ' ' || e.code === 'Space') {
// 如果当前单词包含空格,且当前输入位置应该是空格,则视为正常输入
@@ -341,12 +341,12 @@ function onTyping(e: KeyboardEvent) {
if (!currentWord.isSymbol) {
playCorrect()
}
-
+
// 检查是否是句子的最后一个单词
const isLastWordInSentence = wordIndex + 1 >= currentSentence.words.length;
-
+
if (isLastWordInSentence) {
- // 如果是句子的最后一个单词,自动跳转到下一句
+ // 如果是句子的最后一个单词,自动跳转到下一句,不用再输入空格
nextSentence();
} else if (currentWord.nextSpace) {
// 如果不是最后一个单词,且需要空格,设置等待空格输入
@@ -356,10 +356,10 @@ function onTyping(e: KeyboardEvent) {
nextWord();
}
}
-
+
// 更新当前单词信息
updateCurrentWordInfo(currentWord);
-
+
playKeyboardAudio()
}
e.preventDefault()
@@ -528,19 +528,19 @@ function onContextMenu(e: MouseEvent, sentence: Sentence, i, j, w) {
onMounted(() => {
// 初始化当前单词信息
- if (props.article.sections &&
- props.article.sections[sectionIndex] &&
- props.article.sections[sectionIndex][sentenceIndex] &&
+ if (props.article.sections &&
+ props.article.sections[sectionIndex] &&
+ props.article.sections[sectionIndex][sentenceIndex] &&
props.article.sections[sectionIndex][sentenceIndex].words[wordIndex]) {
updateCurrentWordInfo(props.article.sections[sectionIndex][sentenceIndex].words[wordIndex]);
}
-
+
emitter.on(EventKey.resetWord, () => {
wrong = input = ''
// 重置时更新当前单词信息
- if (props.article.sections &&
- props.article.sections[sectionIndex] &&
- props.article.sections[sectionIndex][sentenceIndex] &&
+ if (props.article.sections &&
+ props.article.sections[sectionIndex] &&
+ props.article.sections[sectionIndex][sentenceIndex] &&
props.article.sections[sectionIndex][sentenceIndex].words[wordIndex]) {
updateCurrentWordInfo(props.article.sections[sectionIndex][sentenceIndex].words[wordIndex]);
}
diff --git a/src/pages/pc/article/components/TypingWord.vue b/src/pages/pc/article/components/TypingWord.vue
index ab8a62c9..6f45c94c 100644
--- a/src/pages/pc/article/components/TypingWord.vue
+++ b/src/pages/pc/article/components/TypingWord.vue
@@ -31,7 +31,10 @@ const list = $computed(() => {
}
}
props.word.input.split('').forEach((k, i) => {
- if (k === ' ') t.push({type: 'space'})
+ if (k === ' ') {
+ right = wrong = ''
+ t.push({type: 'space'})
+ }
else {
if (compare(k, props.word.word[i])) {
right += k
diff --git a/src/pages/pc/components/base/InputNumber.vue b/src/pages/pc/components/base/InputNumber.vue
index 876a797f..bc70c3fd 100644
--- a/src/pages/pc/components/base/InputNumber.vue
+++ b/src/pages/pc/components/base/InputNumber.vue
@@ -40,7 +40,7 @@