feat: allow skipping blank spaces in article practice mode

This commit is contained in:
Zyronon
2025-11-14 03:39:33 +00:00
parent 842838aba0
commit 6696d2f461
5 changed files with 34 additions and 15 deletions

View File

@@ -62,7 +62,9 @@ async function init() {
store.load = true
setTheme(settingStore.theme)
if (!settingStore.first) {
if (settingStore.first) {
set(APP_VERSION.key,APP_VERSION.version)
}else {
get(APP_VERSION.key).then(r => {
runtimeStore.isNew = r ? (APP_VERSION.version > Number(r)) : true
})

View File

@@ -245,6 +245,7 @@ function nextSentence() {
}
function onTyping(e: KeyboardEvent) {
debugger
if (!props.article.sections.length) return
if (isTyping || isEnd) return;
isTyping = true;
@@ -277,12 +278,16 @@ function onTyping(e: KeyboardEvent) {
if (e.code === 'Space') {
next()
} else {
wrong = ' '
playBeep()
setTimeout(() => {
wrong = ''
wrong = input = ''
}, 500)
// 如果在第一个单词的最后一位上, 不按空格的直接输入下一个字母的话
next()
isTyping = false
onTyping(e)
// wrong = ' '
// playBeep()
// setTimeout(() => {
// wrong = ''
// wrong = input = ''
// }, 500)
}
} else {
//如果是首句首词

View File

@@ -555,7 +555,7 @@ function importOldData() {
<div class="line"></div>
<SettingItem mainTitle="自动切换"/>
<SettingItem title="自动切换下一个单词"
desc="未开启自动切换时,当输入完成后请使用 **空格键** 切换下一个"
desc="仅在 **跟写** 时生效,听写、辨认、默写均不会自动切换,需要手动按 **空格键** 切换"
>
<Switch v-model="settingStore.autoNextWord"/>
</SettingItem>
@@ -684,6 +684,22 @@ function importOldData() {
</div>
<div v-if="tabIndex === 5">
<div class="log-item">
<div class="mb-2">
<div>
<div>更新日期2025/11/14</div>
<div>更新内容新增文章练习时可跳过空格如果在单词的最后一位上不按空格直接输入下一个字母的话自动跳下一个单词 按空格也自动跳下一个单词</div>
</div>
</div>
</div>
<div class="log-item">
<div class="mb-2">
<div>
<div>更新日期2025/11/13</div>
<div>更新内容新增文章练习时输入时忽略符号/数字选项</div>
</div>
</div>
</div>
<div class="log-item">
<div class="mb-2">
<div>

View File

@@ -86,6 +86,8 @@ function startPractice() {
complete: store.sdict.complete,
wordPracticeMode: settingStore.wordPracticeMode
})
//把是否是第一次设置为false
settingStore.first = false
nav('practice-words/' + store.sdict.id, {}, {taskWords: currentStudy})
} else {
window.umami?.track('no-dict')

View File

@@ -117,13 +117,7 @@ export const useSettingStore = defineStore('setting', {
},
init() {
return new Promise(async resolve => {
//TODO 后面记得删除了
let configStr = localStorage.getItem(SAVE_SETTING_KEY.key)
let configStr2 = await get(SAVE_SETTING_KEY.key)
if (configStr2) {
//兼容localStorage.getItem
configStr = configStr2
}
let configStr = await get(SAVE_SETTING_KEY.key)
let data = checkAndUpgradeSaveSetting(configStr)
if (CAN_REQUEST) {
let res = await getSetting()