fix:旧方法,mock数据删除

This commit is contained in:
小张 2025-08-26 19:07:48 +08:00
parent 829660dbda
commit a5a802c4a6
2 changed files with 109 additions and 109 deletions

View File

@ -726,7 +726,7 @@ const { loginModalVisible, registerModalVisible, handleAuthSuccess, showLoginMod
// enrollCourse 使
//
const currentSection = ref<CourseSection | null>(null)
// const currentSection = ref<CourseSection | null>(null)
//
const course = ref<Course | null>(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 = () => {

View File

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