From 4c69fdf4fceb717ee86099ce6cd5e5e6a901ad0f Mon Sep 17 00:00:00 2001 From: username Date: Tue, 22 Jul 2025 20:59:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=AD=A6=E4=B9=A0=E8=B7=AF=E5=BE=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/AppHeader.vue | 14 +- src/i18n/locales/en.json | 10 +- src/i18n/locales/zh.json | 8 +- src/router/index.ts | 9 + src/views/LearningPaths.vue | 732 ++++++++++++++++++++++++++++ 5 files changed, 759 insertions(+), 14 deletions(-) create mode 100644 src/views/LearningPaths.vue diff --git a/src/components/layout/AppHeader.vue b/src/components/layout/AppHeader.vue index b724704..bad33c5 100644 --- a/src/components/layout/AppHeader.vue +++ b/src/components/layout/AppHeader.vue @@ -17,15 +17,19 @@ {{ t('header.courses') }} + - - @@ -115,10 +127,12 @@ import { useUserStore } from '@/stores/user' import { PersonOutline, LogOutOutline, - SettingsOutline, MenuOutline, CloseOutline } from '@vicons/ionicons5' +import LoginModal from '@/components/auth/LoginModal.vue' +import RegisterModal from '@/components/auth/RegisterModal.vue' +import SafeAvatar from '@/components/common/SafeAvatar.vue' const router = useRouter() const { t, locale } = useI18n() @@ -131,6 +145,12 @@ const mobileMenuOpen = ref(false) // 当前激活的菜单项 const activeKey = ref('home') +// 认证模态框相关 +const loginModalVisible = ref(false) +const registerModalVisible = ref(false) + + + // 语言切换相关 @@ -158,20 +178,15 @@ const switchLanguage = (lang: string) => { // 用户菜单选项 const userMenuOptions = computed(() => [ { - label: t('header.profile'), + label: '个人中心', key: 'profile', icon: () => h(PersonOutline) }, - { - label: t('header.settings'), - key: 'settings', - icon: () => h(SettingsOutline) - }, { type: 'divider' }, { - label: t('header.logout'), + label: '退出登录', key: 'logout', icon: () => h(LogOutOutline) } @@ -212,9 +227,6 @@ const handleUserMenuSelect = (key: string) => { case 'profile': router.push('/profile') break - case 'settings': - // TODO: 实现设置页面 - break case 'logout': userStore.logout() router.push('/') @@ -222,6 +234,24 @@ const handleUserMenuSelect = (key: string) => { } } +// 显示登录模态框 +const showLoginModal = () => { + loginModalVisible.value = true +} + +// 显示注册模态框 +const showRegisterModal = () => { + registerModalVisible.value = true +} + +// 认证成功处理 +const handleAuthSuccess = () => { + // 认证成功后可以进行一些操作,比如刷新用户信息等 + console.log('认证成功') +} + + + // 点击外部关闭下拉框 @@ -694,5 +724,7 @@ onUnmounted(() => { } } + + /* 全屏模式样式现在在App.vue中统一管理 */ diff --git a/src/components/layout/AppLayout.vue b/src/components/layout/AppLayout.vue index dbea3c4..1fc98f0 100644 --- a/src/components/layout/AppLayout.vue +++ b/src/components/layout/AppLayout.vue @@ -1,20 +1,22 @@ + \ No newline at end of file diff --git a/src/views/CourseStudy.vue b/src/views/CourseStudy.vue new file mode 100644 index 0000000..b2c7137 --- /dev/null +++ b/src/views/CourseStudy.vue @@ -0,0 +1,1836 @@ + + + + + diff --git a/src/views/Courses.vue b/src/views/Courses.vue index 2d59ebc..d2f0048 100644 --- a/src/views/Courses.vue +++ b/src/views/Courses.vue @@ -187,7 +187,7 @@
- 筛选结果:找到 {{ filteredCourses.length }} 门相关课程 + 筛选结果:找到 {{ total }} 门相关课程
@@ -197,8 +197,15 @@ 推荐 + +
+
+

正在加载课程...

+
+
+ -
+
@@ -207,7 +214,7 @@

{{ getCourseTitle(course) }}

📚 {{ course.duration }} - ⏰ {{ course.totalTime }} + 💰 ¥{{ course.price }}