diff --git a/components.d.ts b/components.d.ts index c310fff2..ad9fbed2 100644 --- a/components.d.ts +++ b/components.d.ts @@ -43,6 +43,7 @@ declare module 'vue' { IconWrapper: typeof import('./src/components/IconWrapper.vue')['default'] Input: typeof import('./src/components/Input.vue')['default'] List: typeof import('./src/components/List.vue')['default'] + ListItem: typeof import('./src/components/ListItem.vue')['default'] MiniModal: typeof import('./src/components/MiniModal.vue')['default'] Modal: typeof import('./src/components/Modal/Modal.vue')['default'] Options: typeof import('./src/components/Practice/Options.vue')['default'] diff --git a/src/components/Article/ArticleList.vue b/src/components/Article/ArticleList.vue index e8b3ecf1..8a4c9411 100644 --- a/src/components/Article/ArticleList.vue +++ b/src/components/Article/ArticleList.vue @@ -5,6 +5,7 @@ import Input from "@/components/Input.vue"; import {$computed, $ref} from "vue/macros"; import {cloneDeep, throttle} from "lodash-es"; import {Article} from "@/types.ts"; +import ListItem from "@/components/ListItem.vue"; interface IProps { list: Article[] @@ -19,9 +20,7 @@ const emit = defineEmits<{ 'update:list': [list: Article[]], }>() -let dragItem: Article = $ref({id: ''} as any) let searchKey = $ref('') -let draggable = $ref(false) let localList = $computed({ get() { @@ -41,47 +40,6 @@ let localList = $computed({ } }) -function dragstart(item: Article) { - dragItem = item; -} - -const dragenter = throttle((e, item: Article) => { - // console.log('dragenter', 'item.id', item.id, 'dragItem.id', dragItem.id) - e.preventDefault(); - // 避免源对象触发自身的dragenter事件 - if (dragItem.id && dragItem.id !== item.id) { - let rIndex = props.list.findIndex(v => v.id === dragItem.id) - let rIndex2 = props.list.findIndex(v => v.id === item.id) - // console.log('dragenter', 'item-Index', rIndex2, 'dragItem.index', rIndex) - //这里不能直接用localList splice。不知道为什么会导致有筛选的情况下,多动无法变换位置 - let temp = cloneDeep(props.list) - temp.splice(rIndex, 1); - temp.splice(rIndex2, 0, cloneDeep(dragItem)); - localList = temp; - } -}, 300) - -function dragover(e) { - // console.log('dragover') - e.preventDefault(); -} - -function dragend() { - // console.log('dragend') - draggable = false - dragItem = {id: ''} as Article -} - -function delItem(item: Article) { - if (item.id === props.selectItem.id) { - emit('delSelectItem') - } - let rIndex = props.list.findIndex(v => v.id === item.id) - if (rIndex > -1) { - localList.splice(rIndex, 1) - } -} - let el: HTMLDivElement = $ref() function scrollBottom() { @@ -103,64 +61,16 @@ defineExpose({scrollBottom}) - -
-
-
{{ `${index + 1}. ${item.title}` }}
-
{{ ` ${item.titleTranslate}` }}
-
-
- - -
- -
-
-
-
+ +
{{ `${index + 1}. ${item.title}` }}
+
{{ ` ${item.titleTranslate}` }}
+
\ No newline at end of file diff --git a/src/components/ListItem.vue b/src/components/ListItem.vue new file mode 100644 index 00000000..3d06e26e --- /dev/null +++ b/src/components/ListItem.vue @@ -0,0 +1,80 @@ + + + + + \ No newline at end of file diff --git a/src/components/Practice/Footer.vue b/src/components/Practice/Footer.vue index 38e7f910..cf9d0cb7 100644 --- a/src/components/Practice/Footer.vue +++ b/src/components/Practice/Footer.vue @@ -86,11 +86,11 @@ onUnmounted(() => { margin-bottom: 10rem; transition: all .3s; position: relative; - margin-top: 20rem; + margin-top: 15rem; &.hide { margin-bottom: -90rem; - margin-top: 65rem; + margin-top: 50rem; .progress { bottom: calc(100% + 20rem); diff --git a/src/components/Practice/PracticeWord/Typing.vue b/src/components/Practice/PracticeWord/Typing.vue index 4efbfb02..93a428ce 100644 --- a/src/components/Practice/PracticeWord/Typing.vue +++ b/src/components/Practice/PracticeWord/Typing.vue @@ -147,33 +147,33 @@ defineExpose({del, showWord, hideWord}) @@ -182,9 +182,11 @@ defineExpose({del, showWord, hideWord}) .typing-word { width: 100%; + flex: 1; display: flex; flex-direction: column; align-items: center; + justify-content: center; .phonetic, .translate { font-size: 20rem; @@ -192,6 +194,12 @@ defineExpose({del, showWord, hideWord}) transition: all .3s; } + .translate{ + position: absolute; + transform: translateY(-50%); + margin-bottom: 90rem; + } + .word-wrapper { display: flex; align-items: center; diff --git a/src/components/Practice/PracticeWord/TypingWord.vue b/src/components/Practice/PracticeWord/TypingWord.vue index ae47bb66..a816426a 100644 --- a/src/components/Practice/PracticeWord/TypingWord.vue +++ b/src/components/Practice/PracticeWord/TypingWord.vue @@ -104,6 +104,7 @@ function next(isTyping: boolean = true) { emitter.emit(EventKey.openStatModal, stat) } } else { + 2 data.index++ isTyping && practiceStore.inputWordNumber++ console.log('这个词完了') @@ -205,11 +206,14 @@ useOnKeyboardEventListener(onKeyDown, onKeyUp) @wrong="wordWrong" @next="next" /> - +
+ +
+
@@ -302,6 +306,11 @@ useOnKeyboardEventListener(onKeyDown, onKeyUp) } } + .options-wrapper{ + position: absolute; + //bottom: 0; + margin-top: 120rem; + } } $article-width: 50vw; diff --git a/src/components/WordItem.vue b/src/components/WordItem.vue index a66f0412..98ca3785 100644 --- a/src/components/WordItem.vue +++ b/src/components/WordItem.vue @@ -1,12 +1,12 @@ \ No newline at end of file diff --git a/src/components/WordList.vue b/src/components/WordList.vue index 1d3916d8..3cdb6fad 100644 --- a/src/components/WordList.vue +++ b/src/components/WordList.vue @@ -71,46 +71,5 @@ watch(() => props.list, () => { padding: 0 $space; overflow: auto; - .item { - background: var(--color-header-bg); - border-radius: 6rem; - padding: 12rem; - display: flex; - justify-content: space-between; - transition: all .3s; - color: var(--color-font-1); - - &.active { - background: $second; - color: white; - } - - &:hover { - //background: $dark-main-bg; - //background: $item-hover; - background: rgb(226, 226, 226); - } - - .left { - .letter { - margin-bottom: 10rem; - font-size: 24rem; - line-height: 1; - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace; - display: flex; - } - - .info { - display: flex; - gap: 20rem - } - } - - .right { - display: flex; - flex-direction: column; - justify-content: space-between; - } - } } diff --git a/src/stores/base.ts b/src/stores/base.ts index eb32a03c..f9419a47 100644 --- a/src/stores/base.ts +++ b/src/stores/base.ts @@ -26,8 +26,8 @@ export const useBaseStore = defineStore('base', { ...cloneDeep(DefaultDict), words: [ { - "name": "cancel", - "trans": [], + "name": "cancelcancelcancelcancelcancelcancelcancelcancel", + "trans": ['取消取消取消取消取消取消取消取消取消取消取消取消取消取消取消取消'], "usphone": "", "ukphone": "" }, @@ -194,10 +194,10 @@ export const useBaseStore = defineStore('base', { } ], current: { - // dictType: DictType.word, - // index: 1, - dictType: DictType.article, - index: 0, + dictType: DictType.word, + index: 1, + // dictType: DictType.article, + // index: 0, practiceType: DictType.word, }, simpleWords: [