diff --git a/src/components/Footer.vue b/src/components/Footer.vue
index e57d376f..c7a88bb4 100644
--- a/src/components/Footer.vue
+++ b/src/components/Footer.vue
@@ -6,6 +6,15 @@ import {useBaseStore} from "@/stores/base.ts"
import Tooltip from "@/components/Tooltip.vue"
import {Down} from "@icon-park/vue-next"
+interface IProps {
+ total: number,
+ inputNumber: number
+ wrongNumber: number
+ correctRate: number
+}
+
+const props = defineProps()
+
const store = useBaseStore()
function format(val: number, suffix: string = '') {
diff --git a/src/components/Footer2.vue b/src/components/Footer2.vue
new file mode 100644
index 00000000..8d566c72
--- /dev/null
+++ b/src/components/Footer2.vue
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Type.vue b/src/components/Type.vue
index 6915e9ab..7796fcd5 100644
--- a/src/components/Type.vue
+++ b/src/components/Type.vue
@@ -76,7 +76,7 @@ function next() {
console.log('这个词完了')
}
- if ([DictType.customDict, DictType.innerDict].includes(store.current.dictType) && store.skipWordNames.includes(store.word.name)) {
+ if ([DictType.customDict, DictType.innerDict].includes(store.current.dictType) && store.skipWordNames.includes(store.word.name.toLowerCase())) {
next()
}
@@ -103,12 +103,12 @@ async function onKeyDown(e: KeyboardEvent) {
wrong = ''
playKeySound()
} else {
- if (!store.wrongWordDict.originWords.find((v: Word) => v.name === store.word.name)) {
+ if (!store.wrongWordDict.originWords.find((v: Word) => v.name.toLowerCase() === store.word.name.toLowerCase())) {
store.wrongWordDict.originWords.push(store.word)
store.wrongWordDict.words.push(store.word)
store.wrongWordDict.chapterWords = [store.wrongWordDict.words]
}
- if (!store.current.wrongWords.find((v: Word) => v.name === store.word.name)) {
+ if (!store.current.wrongWords.find((v: Word) => v.name.toLowerCase() === store.word.name.toLowerCase())) {
store.current.wrongWords.push(store.word)
}
store.current.statistics.correctRate = Math.trunc(((store.current.index + 1 - store.current.wrongWords.length) / (store.current.index + 1)) * 100)
diff --git a/src/components/TypeArticle.vue b/src/components/TypeArticle.vue
index beba6e46..e5fada8d 100644
--- a/src/components/TypeArticle.vue
+++ b/src/components/TypeArticle.vue
@@ -64,7 +64,7 @@ let index = $ref(0)
let input = $ref('')
let wrong = $ref('')
let isSpace = $ref(false)
-let isDictation = $ref(true)
+let isDictation = $ref(false)
let showFullWord = $ref(false)
let hoverIndex = $ref({
sectionIndex: 0,
@@ -80,22 +80,20 @@ let article = reactive({
sections: [],
translate: [],
})
-const simpleWord = [
- 'a', 'an', 'of', 'and',
- 'i', 'my', 'you', 'your',
- 'me', 'am', 'is', 'do', 'are',
- 'what', 'who', 'where', 'how', 'no', 'yes',
- 'not', 'did', 'were', 'can', 'could'
-]
+
onMounted(() => {
- let t1 = useSplitArticle(article.article)
+ let sections = useSplitArticle(article.article)
let wordNumber = 0
- t1.map(v => {
+ sections.map(v => {
v.map(w => {
- wordNumber += w.words.length
+ w.words.map(s=>{
+ if (!store.skipWordNames.includes(s.toLowerCase())){
+ wordNumber++
+ }
+ })
})
})
- console.log('t1', t1)
+ console.log('sections', sections)
console.log('wordNumber', wordNumber)
setTimeout(() => {
@@ -116,9 +114,8 @@ onMounted(() => {
}
}
}, 1000)
- let a = ``
- let t = useSplitArticle(a, 'cn', CnKeyboardMap)
- t.map((v, i) => {
+ let temp = useSplitArticle(article.articleTranslate, 'cn', CnKeyboardMap)
+ temp.map((v, i) => {
v.map((w, j) => {
article.translate.push({
sentence: w.sentence,
@@ -126,7 +123,7 @@ onMounted(() => {
})
})
})
- article.sections = t1
+ article.sections = sections
console.log(cloneDeep(article))
calcTranslateLocation()
})
@@ -172,7 +169,6 @@ function focus() {
inputRef.focus()
}
-
const currentIndex = computed(() => {
return `${sectionIndex}${sentenceIndex}${wordIndex}`
})
diff --git a/src/hooks/useSplitArticle.ts b/src/hooks/useSplitArticle.ts
index c83b636a..4eedf154 100644
--- a/src/hooks/useSplitArticle.ts
+++ b/src/hooks/useSplitArticle.ts
@@ -1,4 +1,4 @@
-import {Sentence} from "@/components/TypeArticle.vue";
+import {Sentence} from "@/types.ts";
interface KeyboardMap {
Period: string,
diff --git a/src/stores/base.ts b/src/stores/base.ts
index f72aee38..d63b7333 100644
--- a/src/stores/base.ts
+++ b/src/stores/base.ts
@@ -85,12 +85,20 @@ export const useBaseStore = defineStore('base', {
value3: 1,
value4: false,
},
+ simpleWords: [
+ 'a', 'an', 'of', 'and',
+ 'i', 'my', 'you', 'your',
+ 'me', 'am', 'is', 'do', 'are',
+ 'what', 'who', 'where', 'how', 'no', 'yes',
+ 'not', 'did', 'were', 'can', 'could', 'it',
+ 'the','to'
+ ],
theme: 'auto'
}
},
getters: {
skipWordNames: (state: State) => {
- return state.skipWordDict.words.map(v => v.name)
+ return state.skipWordDict.originWords.map(v => v.name.toLowerCase()).concat(state.simpleWords)
},
currentDict(state: State): Dict {
switch (state.current.dictType) {
@@ -109,7 +117,7 @@ export const useBaseStore = defineStore('base', {
return this.currentDict.wordIndex
},
chapter(state: State): Word[] {
- return this.currentDict.chapters[this.currentDict.chapterIndex] ?? []
+ return this.currentDict.chapterWords[this.currentDict.chapterIndex] ?? []
},
word(state: State): Word {
return state.current.words[state.current.index] ?? {
diff --git a/src/types.ts b/src/types.ts
index 2ecb3448..2bf1078a 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -155,6 +155,7 @@ export interface State {
repeatNumber: number,
statistics: Statistics
},
+ simpleWords: string[],
sideIsOpen: boolean,
isDictation: boolean,
theme: string,