This commit is contained in:
zyronon
2024-05-28 08:48:03 +08:00
parent 04734c6bd1
commit 137037f2ec
3 changed files with 19 additions and 2 deletions

View File

@@ -139,9 +139,14 @@ let wordData = $ref({
})
function getCurrentPractice() {
if (store.currentStudyWordDict.words?.length) {
let c = store.currentStudy.word
let wordDict = store.currentStudyWordDict;
if (wordDict.words?.length) {
wordData.index = 0
wordData.words = cloneDeep(store.currentStudyWordDict.words.slice(store.currentStudy.word.lastLearnIndex, store.currentStudy.word.lastLearnIndex + store.currentStudy.word.perDayStudyNumber))
wordData.statistics.map(v=>{
})
wordData.words = cloneDeep(wordDict.words.slice(c.lastLearnIndex, c.lastLearnIndex + c.perDayStudyNumber))
emitter.emit(EventKey.resetWord)
}
}

View File

@@ -3,10 +3,12 @@ import {Word} from "@/types.ts"
export interface PracticeState {
wrongWords: Word[],
//todo 废弃
repeatNumber: number,
startDate: number,
total: number,
index: number,//当前输入的第几个用于和total计算进度
newWordNumber: number,
inputWordNumber: number,//当前总输入了多少个单词(不包含跳过)
wrongWordNumber: number,
correctRate: number,
@@ -21,6 +23,7 @@ export const usePracticeStore = defineStore('practice', {
correctRate: -1,
total: 0,
index: 0,
newWordNumber: 0,
inputWordNumber: 0,
wrongWordNumber: 0,
}

View File

@@ -32,6 +32,11 @@ export const DefaultWord: Word = {
trans: [],
}
export type StudyWord = {
type: 'new' | 'repeat' | 'wrong'
word: Word
}
export const PronunciationApi = 'https://dict.youdao.com/dictvoice?audio='
export type TranslateLanguageType = 'en' | 'zh-CN' | 'ja' | 'de' | 'common' | ''
@@ -117,6 +122,8 @@ export const DefaultArticle: Article = {
}
export interface Statistics {
startIndex:number,
endIndex:number,
startDate: number,//开始日期
endDate: number//结束日期
spend: number,//花费时间
@@ -131,6 +138,8 @@ export interface DisplayStatistics extends Statistics {
}
export const DefaultDisplayStatistics: DisplayStatistics = {
startIndex: -1,
endIndex: -1,
startDate: Date.now(),
endDate: -1,
spend: -1,