From 1ce13a7cbbf4e82db82bc0aff27e87eb97a9f3a2 Mon Sep 17 00:00:00 2001 From: zyronon Date: Mon, 18 Aug 2025 02:13:41 +0800 Subject: [PATCH] feat:add seo,learning page can be directly studied through the url --- components.d.ts | 3 + src/App.vue | 21 +---- src/components/icon/VolumeIcon.vue | 22 ++++- src/directives/loading.tsx | 61 ++++++++++++ src/hooks/article.ts | 2 +- src/hooks/event.ts | 14 +-- src/hooks/sound.ts | 1 - src/main.ts | 2 + src/pages/pc/Setting.vue | 3 +- src/pages/pc/article/ArticleHomePage.vue | 4 +- src/pages/pc/article/BatchEditArticlePage.vue | 4 +- src/pages/pc/article/StudyArticle.vue | 92 ++++++++++++++----- .../components/EditSingleArticleModal.vue | 1 + .../pc/article/components/TypingArticle.vue | 3 - src/pages/pc/components/ConflictNotice.vue | 17 ++-- src/pages/pc/word/StudyWord.vue | 72 +++++++++------ src/pages/pc/word/WordHomePage.vue | 9 +- src/stores/setting.ts | 11 ++- src/utils/eventBus.ts | 1 + src/utils/index.ts | 5 + 20 files changed, 238 insertions(+), 110 deletions(-) create mode 100644 src/directives/loading.tsx diff --git a/components.d.ts b/components.d.ts index ceafda84..b30c8bf6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -19,6 +19,9 @@ declare module 'vue' { IconBiArrowRight: typeof import('~icons/bi/arrow-right')['default'] IconBiKeyboard: typeof import('~icons/bi/keyboard')['default'] IconBxHeadphone: typeof import('~icons/bx/headphone')['default'] + IconBxVolume: typeof import('~icons/bx/volume')['default'] + IconBxVolumeFull: typeof import('~icons/bx/volume-full')['default'] + IconBxVolumeLow: typeof import('~icons/bx/volume-low')['default'] IconCarbonCloseOutline: typeof import('~icons/carbon/close-outline')['default'] IconCarbonMove: typeof import('~icons/carbon/move')['default'] IconEosIconsLoading: typeof import('~icons/eos-icons/loading')['default'] diff --git a/src/App.vue b/src/App.vue index d2fa16a3..bb47bc60 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,8 +6,8 @@ import {useSettingStore} from "@/stores/setting.ts"; import useTheme from "@/hooks/theme.ts"; import CollectNotice from "@/pages/pc/components/CollectNotice.vue"; import {SAVE_DICT_KEY, SAVE_SETTING_KEY} from "@/utils/const.ts"; -import {isMobile, shakeCommonDict} from "@/utils"; -import router, {routes} from "@/router.ts"; +import {shakeCommonDict} from "@/utils"; +import {routes} from "@/router.ts"; import {set} from 'idb-keyval' import {useRoute} from "vue-router"; @@ -22,29 +22,18 @@ watch(store.$state, (n: BaseState) => { }) watch(settingStore.$state, (n) => { - console.log('watch',settingStore.$state) set(SAVE_SETTING_KEY.key, JSON.stringify({val: n, version: SAVE_SETTING_KEY.version})) }) async function init() { - // console.time() - store.init().then(() => { - store.load = true - // console.timeEnd() - }) + await store.init() await settingStore.init() + store.load = true setTheme(settingStore.theme) } -onMounted(() => { - init() +onMounted(init) - if (isMobile()) { - // 当前设备是移动设备 - console.log('当前设备是移动设备') - router.replace('/mobile') - } -}) let transitionName = $ref('go') const route = useRoute() watch(() => route.path, (to, from) => { diff --git a/src/components/icon/VolumeIcon.vue b/src/components/icon/VolumeIcon.vue index d109ea4c..114a4d01 100644 --- a/src/components/icon/VolumeIcon.vue +++ b/src/components/icon/VolumeIcon.vue @@ -49,11 +49,23 @@ defineExpose({play})