This commit is contained in:
username 2025-07-22 16:23:15 +08:00
parent 1db293a622
commit f518ea0966
5 changed files with 10 additions and 33 deletions

View File

@ -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) => {

View File

@ -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} - 在线学习平台`

View File

@ -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([

View File

@ -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: '请同意用户协议和隐私政策',

0
v1.txt Normal file
View File