diff --git a/src/views/AICompanion.vue b/src/views/AICompanion.vue index c535edc..b76bdde 100644 --- a/src/views/AICompanion.vue +++ b/src/views/AICompanion.vue @@ -726,7 +726,7 @@ const { loginModalVisible, registerModalVisible, handleAuthSuccess, showLoginMod // enrollCourse 暂时未使用,后续需要时再启用 // 当前选中的章节 -const currentSection = ref(null) +// const currentSection = ref(null) // 课程数据相关状态 const course = ref(null) @@ -767,14 +767,14 @@ const examProgress = ref(0) // } // 计算用户是否已报名 -const isUserEnrolled = computed(() => { - // 必须同时满足:用户已登录 AND 已报名该课程 - return userStore.isLoggedIn && isEnrolled.value +// const isUserEnrolled = computed(() => { +// // 必须同时满足:用户已登录 AND 已报名该课程 +// return userStore.isLoggedIn && isEnrolled.value - // 临时测试不同状态: - // return false // 强制显示未报名状态(灰色不可点击) - // return true // 强制显示已报名状态(彩色可点击) -}) +// // 临时测试不同状态: +// // return false // 强制显示未报名状态(灰色不可点击) +// // return true // 强制显示已报名状态(彩色可点击) +// }) // 报名确认弹窗 const enrollConfirmVisible = ref(false) @@ -1358,86 +1358,86 @@ const getLessonTypeBadgeClass = (section: CourseSection) => { } // 处理下载操作 -const handleDownload = (section: CourseSection) => { - console.log('下载资料:', section) - // 这里可以实现下载逻辑 - alert(`下载资料: ${section.name}`) -} +// const handleDownload = (section: CourseSection) => { +// console.log('下载资料:', section) +// // 这里可以实现下载逻辑 +// alert(`下载资料: ${section.name}`) +// } // 处理作业操作 -const handleHomework = (section: CourseSection) => { - console.log('打开作业:', section) +// const handleHomework = (section: CourseSection) => { +// console.log('打开作业:', section) - // 跳转到练习页面 - router.push({ - name: 'Practice', - params: { - courseId: courseId.value, - sectionId: section.id - }, - query: { - courseName: course.value?.title || '课程名称', - practiceName: section.name - } - }) -} +// // 跳转到练习页面 +// router.push({ +// name: 'Practice', +// params: { +// courseId: courseId.value, +// sectionId: section.id +// }, +// query: { +// courseName: course.value?.title || '课程名称', +// practiceName: section.name +// } +// }) +// } // 处理考试操作 -const handleExam = (section: CourseSection) => { - console.log('开始考试:', section) +// const handleExam = (section: CourseSection) => { +// console.log('开始考试:', section) - // 跳转到考前须知页面 - router.push({ - name: 'ExamNotice', - params: { - courseId: courseId.value, - sectionId: section.id - }, - query: { - courseName: course.value?.title || '课程名称', - examName: section.name - } - }) -} +// // 跳转到考前须知页面 +// router.push({ +// name: 'ExamNotice', +// params: { +// courseId: courseId.value, +// sectionId: section.id +// }, +// query: { +// courseName: course.value?.title || '课程名称', +// examName: section.name +// } +// }) +// } // 点击课程章节标题 -const handleSectionClick = (section: CourseSection) => { - console.log('点击课程章节:', section) +// const handleSectionClick = (section: CourseSection) => { +// console.log('点击课程章节:', section) - // 设置当前选中的章节 - currentSection.value = section +// // 设置当前选中的章节 +// currentSection.value = section - // 检查是否有视频链接 - if (section.outline && section.outline.includes('.m3u8')) { - console.log('获取到视频链接:', section.outline) +// // 检查是否有视频链接 +// if (section.outline && section.outline.includes('.m3u8')) { +// console.log('获取到视频链接:', section.outline) - // 跳转到已报名区域并播放视频 - navigateToEnrolledArea(section.outline, section.name) - } else { - // 如果不是视频,显示预览 - previewSection(section) - } -} +// // 跳转到已报名区域并播放视频 +// navigateToEnrolledArea(section.outline, section.name) +// } else { +// // 如果不是视频,显示预览 +// previewSection(section) +// } +// } // 跳转到已报名区域 -const navigateToEnrolledArea = (videoUrl: string, sectionName: string) => { - console.log('跳转到已报名区域,播放视频:', videoUrl) - console.log('章节名称:', sectionName) - console.log('当前章节:', currentSection.value) +// const navigateToEnrolledArea = (videoUrl: string, sectionName: string) => { +// console.log('跳转到已报名区域,播放视频:', videoUrl) +// console.log('章节名称:', sectionName) +// console.log('当前章节:', currentSection.value) - // 使用路由跳转到学习页面 - router.push({ - name: 'CourseStudy', - params: { id: courseId.value }, - query: { - videoUrl: encodeURIComponent(videoUrl), - sectionName: encodeURIComponent(sectionName), - sectionId: currentSection.value?.id - } - }) -} +// // 使用路由跳转到学习页面 +// router.push({ +// name: 'CourseStudy', +// params: { id: courseId.value }, +// query: { +// videoUrl: encodeURIComponent(videoUrl), +// sectionName: encodeURIComponent(sectionName), +// sectionId: currentSection.value?.id +// } +// }) +// } // 更新视频播放器(备用方案) // const updateVideoPlayer = (videoUrl: string, sectionName: string) => { @@ -1454,14 +1454,14 @@ const navigateToEnrolledArea = (videoUrl: string, sectionName: string) => { // } // 预览章节(非视频内容) -const previewSection = (section: CourseSection) => { - console.log('预览章节:', section) +// const previewSection = (section: CourseSection) => { +// console.log('预览章节:', section) - previewModalTitle.value = section.name - previewModalContent.value = `章节ID: ${section.id}\n章节名称: ${section.name}\n内容类型: ${getLessonTypeText(section)}` - previewModalType.value = 'section' - previewModalVisible.value = true -} +// previewModalTitle.value = section.name +// previewModalContent.value = `章节ID: ${section.id}\n章节名称: ${section.name}\n内容类型: ${getLessonTypeText(section)}` +// previewModalType.value = 'section' +// previewModalVisible.value = true +// } // 关闭预览模态框 const closePreviewModal = () => { diff --git a/src/views/CourseExchanged.vue b/src/views/CourseExchanged.vue index e303d30..1b95b10 100644 --- a/src/views/CourseExchanged.vue +++ b/src/views/CourseExchanged.vue @@ -955,7 +955,7 @@ import { ref, computed, onMounted, onActivated } from 'vue' import { useRoute, useRouter } from 'vue-router' import { useMessage } from 'naive-ui' // import { useAuth } from '@/composables/useAuth' -import { useUserStore } from '@/stores/user' +// import { useUserStore } from '@/stores/user' import { CourseApi } from '@/api/modules/course' import type { Course, CourseSection } from '@/api/types' import QuillEditor from '@/components/common/QuillEditor.vue' @@ -967,7 +967,7 @@ import DPlayerVideo from '@/components/course/DPlayerVideo.vue' const route = useRoute() const router = useRouter() -const userStore = useUserStore() +// const userStore = useUserStore() const message = useMessage() const courseId = ref(String(route.params.id)) // const { loginModalVisible, registerModalVisible, handleAuthSuccess, showLoginModal } = useAuth() @@ -1015,14 +1015,14 @@ const examProgress = ref(0) // } // 计算用户是否已报名 -const isUserEnrolled = computed(() => { - // 必须同时满足:用户已登录 AND 已报名该课程 - return userStore.isLoggedIn && isEnrolled.value +// const isUserEnrolled = computed(() => { +// // 必须同时满足:用户已登录 AND 已报名该课程 +// return userStore.isLoggedIn && isEnrolled.value - // 临时测试不同状态: - // return false // 强制显示未报名状态(灰色不可点击) - // return true // 强制显示已报名状态(彩色可点击) -}) +// // 临时测试不同状态: +// // return false // 强制显示未报名状态(灰色不可点击) +// // return true // 强制显示已报名状态(彩色可点击) +// }) // 报名确认弹窗 const enrollConfirmVisible = ref(false) @@ -1135,22 +1135,22 @@ const previewModalContent = ref('') const previewModalType = ref('') // 视频播放相关 -const VIDEO_CONFIG = { - // 本地视频(当前使用) - LOCAL: '/video/first.mp4', - // HLS流(服务器准备好后使用) - HLS: 'http://110.42.96.65:55513/learn/index.m3u8' -} +// const VIDEO_CONFIG = { +// // 本地视频(当前使用) +// LOCAL: '/video/first.mp4', +// // HLS流(服务器准备好后使用) +// HLS: 'http://110.42.96.65:55513/learn/index.m3u8' +// } // 获取视频URL的函数 -const getVideoUrl = (section?: CourseSection) => { - const outline = section?.outline?.trim() - if (outline && (outline.endsWith('.mp4') || outline.endsWith('.m3u8'))) { - return outline - } - // 当前使用本地视频,将来可以通过环境变量或配置切换 - return VIDEO_CONFIG.LOCAL -} +// const getVideoUrl = (section?: CourseSection) => { +// const outline = section?.outline?.trim() +// if (outline && (outline.endsWith('.mp4') || outline.endsWith('.m3u8'))) { +// return outline +// } +// // 当前使用本地视频,将来可以通过环境变量或配置切换 +// return VIDEO_CONFIG.LOCAL +// } // 视频播放相关状态 const currentVideoUrl = ref('') @@ -1762,14 +1762,14 @@ const handleSectionClick = (section: CourseSection) => { // } // 预览章节(非视频内容) -const previewSection = (section: CourseSection) => { - console.log('预览章节:', section) +// const previewSection = (section: CourseSection) => { +// console.log('预览章节:', section) - previewModalTitle.value = section.name - previewModalContent.value = `章节ID: ${section.id}\n章节名称: ${section.name}\n内容类型: ${getLessonTypeText(section)}` - previewModalType.value = 'section' - previewModalVisible.value = true -} +// previewModalTitle.value = section.name +// previewModalContent.value = `章节ID: ${section.id}\n章节名称: ${section.name}\n内容类型: ${getLessonTypeText(section)}` +// previewModalType.value = 'section' +// previewModalVisible.value = true +// } // 关闭预览模态框 const closePreviewModal = () => {