7.22
This commit is contained in:
parent
1db293a622
commit
f518ea0966
@ -107,7 +107,7 @@ import { ref, computed, h, onMounted, onUnmounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { useCourseStore } from '@/stores/course'
|
||||
|
||||
import {
|
||||
PersonOutline,
|
||||
LogOutOutline,
|
||||
@ -119,7 +119,7 @@ import {
|
||||
const router = useRouter()
|
||||
const { t, locale } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const courseStore = useCourseStore()
|
||||
|
||||
|
||||
// 移动端菜单状态
|
||||
const mobileMenuOpen = ref(false)
|
||||
@ -127,8 +127,7 @@ const mobileMenuOpen = ref(false)
|
||||
// 当前激活的菜单项
|
||||
const activeKey = ref('home')
|
||||
|
||||
// 搜索查询
|
||||
const searchQuery = ref('')
|
||||
|
||||
|
||||
// 语言切换相关
|
||||
const showLanguageDropdown = ref(false)
|
||||
@ -222,13 +221,7 @@ const handleUserMenuSelect = (key: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理搜索
|
||||
const handleSearch = () => {
|
||||
if (searchQuery.value.trim()) {
|
||||
courseStore.searchQuery = searchQuery.value
|
||||
router.push('/courses')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 点击外部关闭下拉框
|
||||
const handleClickOutside = (event: Event) => {
|
||||
|
@ -82,7 +82,7 @@ const routes: RouteRecordRaw[] = [
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
scrollBehavior(_to, _from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
} else {
|
||||
@ -92,7 +92,7 @@ const router = createRouter({
|
||||
})
|
||||
|
||||
// 路由守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
router.beforeEach((to, _from, next) => {
|
||||
// 设置页面标题
|
||||
if (to.meta.title) {
|
||||
document.title = `${to.meta.title} - 在线学习平台`
|
||||
|
@ -192,7 +192,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
@ -201,23 +201,7 @@ const courseId = ref(route.params.id)
|
||||
// 当前激活的标签页
|
||||
const activeTab = ref('details')
|
||||
|
||||
// 课程基本信息
|
||||
const course = ref({
|
||||
id: courseId.value,
|
||||
title: 'DeepSeek入门到精通',
|
||||
subtitle: '深度学习框架DeepSeek从入门到精通',
|
||||
description: '本课程深度解析DeepSeek深度学习框架,从基础概念到实际应用,帮助学习者全面理解AI模型的构建与优化。通过理论讲解与实践操作相结合的方式,让学员掌握深度学习的核心技术。',
|
||||
thumbnail: '/course-thumbnail.jpg',
|
||||
studentsCount: '1,234',
|
||||
duration: '15天',
|
||||
difficulty: '初级到高级',
|
||||
instructor: {
|
||||
name: '张教授',
|
||||
title: 'AI专家 / 深度学习研究员',
|
||||
avatar: '/instructor-avatar.jpg',
|
||||
description: '拥有10年以上AI研究经验,专注于深度学习算法优化和应用。发表论文50余篇,指导学生100+。'
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 课程章节
|
||||
const courseChapters = ref([
|
||||
|
@ -183,7 +183,7 @@ const rules: FormRules = {
|
||||
trigger: ['input', 'blur']
|
||||
},
|
||||
{
|
||||
validator: (rule, value) => {
|
||||
validator: (_rule, value) => {
|
||||
return value === formData.password
|
||||
},
|
||||
message: '两次输入的密码不一致',
|
||||
@ -192,7 +192,7 @@ const rules: FormRules = {
|
||||
],
|
||||
agreement: [
|
||||
{
|
||||
validator: (rule, value) => {
|
||||
validator: (_rule, value) => {
|
||||
return value === true
|
||||
},
|
||||
message: '请同意用户协议和隐私政策',
|
||||
|
Loading…
x
Reference in New Issue
Block a user