|
|
@@ -0,0 +1,1121 @@
|
|
|
+<template>
|
|
|
+ <!-- ======================================== -->
|
|
|
+ <!-- 网页端:完整布局 -->
|
|
|
+ <!-- ======================================== -->
|
|
|
+ <div class="home-container" @click="handlePageClick">
|
|
|
+ <!-- 网页端:展开收起侧边栏按钮 -->
|
|
|
+ <div
|
|
|
+ class="icon-expand"
|
|
|
+ :style="{
|
|
|
+ backgroundColor: drawerVisible ? '#44449c' : '#7F70C840',
|
|
|
+ left: drawerVisible ? '18%' : '0',
|
|
|
+ }"
|
|
|
+ @click="toggleDrawer"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="vertical-lines"
|
|
|
+ :style="{
|
|
|
+ color: drawerVisible ? '#8a78d0' : 'white'
|
|
|
+ }"
|
|
|
+ >||</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 网页端:抽屉式侧边栏 -->
|
|
|
+ <el-drawer
|
|
|
+ v-model="drawerVisible"
|
|
|
+ direction="ltr"
|
|
|
+ size="18%"
|
|
|
+ :with-header="false"
|
|
|
+ >
|
|
|
+ <div class="drawer-box">
|
|
|
+ <el-row class="tac">
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="mb-2">
|
|
|
+ <img :src="classImages" alt="课程小节图标" />
|
|
|
+ 课程小节
|
|
|
+ </span>
|
|
|
+ <el-menu
|
|
|
+ :default-active="currentChapterId"
|
|
|
+ @select="handleSelect"
|
|
|
+ >
|
|
|
+ <template v-for="(chapter, index) in chapters" :key="chapter.id">
|
|
|
+ <el-menu-item :index="chapter.id">
|
|
|
+ {{ String(index + 1).padStart(2, '0') }}. {{ chapter.title }}
|
|
|
+ </el-menu-item>
|
|
|
+ </template>
|
|
|
+ </el-menu>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+
|
|
|
+ <!-- 网页端:内容区域 -->
|
|
|
+ <div class="content-box">
|
|
|
+ <div class="box-1">
|
|
|
+ <div class="inner-box left-box">
|
|
|
+ <div class="box-icon" @click="goBack">
|
|
|
+ <el-icon class="left-icon"><ArrowLeftBold /></el-icon>
|
|
|
+ {{ courseInfo.title }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="inner-box right-box">
|
|
|
+ <div class="top-right-box">
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="searchKeyword"
|
|
|
+ :fetch-suggestions="querySearch"
|
|
|
+ placeholder="搜索"
|
|
|
+ @select="handleSearchSelect"
|
|
|
+ class="search-input"
|
|
|
+ value-key="title"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ >
|
|
|
+ <template #prefix>
|
|
|
+ <el-icon class="el-input__icon"><Search /></el-icon>
|
|
|
+ </template>
|
|
|
+ <template #popper-append-to-body>
|
|
|
+ <el-option
|
|
|
+ v-for="item in filteredTitles"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.title"
|
|
|
+ :value="item"
|
|
|
+ ></el-option>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="box-2">
|
|
|
+ <div class="small-title">
|
|
|
+ <span>{{ courseInfo.title }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <VideoPlayer
|
|
|
+ v-if="!isMobile && currentCourse && currentCourse.courseContentType === 'video'"
|
|
|
+ :key="'web-' + (currentCourse?.id || currentChapterId)"
|
|
|
+ :contentType="currentCourse.courseContentType"
|
|
|
+ :videoPath="currentCourse.courseVideoPath"
|
|
|
+ :courseId="currentCourse.id || ''"
|
|
|
+ :typeId="typeId"
|
|
|
+ :courseConfigList="currentCourse.courseConfigList || []"
|
|
|
+ :allIndices="chapterIds"
|
|
|
+ :currentIndex="currentChapterId"
|
|
|
+ :isFullscreen="isFullscreen"
|
|
|
+ @switchVideo="handleSelect"
|
|
|
+ @saveProgress="handleSaveProgress"
|
|
|
+ @fullscreenChange="handleFullscreenChange"
|
|
|
+ />
|
|
|
+
|
|
|
+ <div class="video-switch">
|
|
|
+ <div class="caret-left" @click="playPreviousVideo">
|
|
|
+ <el-button type="warning" round :disabled="chapterIds.indexOf(currentChapterId) === 0">
|
|
|
+ <img :src="leftImg" alt="Left" />上一节</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="caret-right" @click="playNextVideo">
|
|
|
+ <el-button type="warning" round :disabled="chapterIds.indexOf(currentChapterId) === chapterIds.length - 1"
|
|
|
+ >下一节<img :src="rightImg" alt="Right" />
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- ======================================== -->
|
|
|
+ <!-- 手机端:完整布局 -->
|
|
|
+ <!-- ======================================== -->
|
|
|
+ <div class="mobile-container">
|
|
|
+ <!-- 手机端:顶部导航栏 - 悬浮在视频上方 -->
|
|
|
+ <div class="mobile-header" :class="{ 'header-hidden': headerHidden }">
|
|
|
+ <button class="mobile-back-btn" @click="goBack">
|
|
|
+ <el-icon><ArrowLeftBold /></el-icon>
|
|
|
+ </button>
|
|
|
+ <span class="mobile-header-title">{{ courseInfo.title }}</span>
|
|
|
+ <div class="mobile-header-placeholder"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 手机端:视频播放区域 -->
|
|
|
+ <div class="mobile-video-area">
|
|
|
+ <!-- 手机端视频播放器 -->
|
|
|
+ <VideoPlayer
|
|
|
+ v-if="isMobile && currentCourse && currentCourse.courseContentType === 'video'"
|
|
|
+ :key="'mobile-' + (currentCourse?.id || currentChapterId)"
|
|
|
+ :contentType="currentCourse.courseContentType"
|
|
|
+ :videoPath="currentCourse.courseVideoPath"
|
|
|
+ :courseId="currentCourse.id || ''"
|
|
|
+ :typeId="typeId"
|
|
|
+ :courseConfigList="currentCourse.courseConfigList || []"
|
|
|
+ :allIndices="chapterIds"
|
|
|
+ :currentIndex="currentChapterId"
|
|
|
+ :isFullscreen="isFullscreen"
|
|
|
+ @switchVideo="handleSelect"
|
|
|
+ @saveProgress="handleSaveProgress"
|
|
|
+ @videoPlay="onVideoPlay"
|
|
|
+ @videoPause="onVideoPause"
|
|
|
+ @fullscreenChange="handleFullscreenChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 手机端:搜索框 -->
|
|
|
+ <div v-if="isMobile" class="mobile-search-container">
|
|
|
+ <el-input
|
|
|
+ v-model="searchKeyword"
|
|
|
+ placeholder="搜索课程内容..."
|
|
|
+ class="mobile-search-input"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleSearchSubmit"
|
|
|
+ >
|
|
|
+ <template #prefix>
|
|
|
+ <el-icon><Search /></el-icon>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 手机端:章节列表 -->
|
|
|
+ <div class="mobile-chapter-list">
|
|
|
+ <div
|
|
|
+ v-for="(chapter, index) in filteredTitles"
|
|
|
+ :key="chapter.id"
|
|
|
+ class="mobile-chapter-item"
|
|
|
+ :class="{ active: currentChapterId === chapter.id }"
|
|
|
+ @click="playChapter(chapter)"
|
|
|
+ >
|
|
|
+ <div class="mobile-chapter-info">
|
|
|
+ <div class="mobile-chapter-title-row">
|
|
|
+ <span class="mobile-chapter-number">{{ String(index + 1).padStart(2, '0') }}.</span>
|
|
|
+ <span class="mobile-chapter-title">{{ videoPathMap[chapter.id]?.courseName || '' }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="mobile-chapter-meta">
|
|
|
+ <span class="mobile-chapter-type">视频时长</span>
|
|
|
+ <span class="mobile-chapter-divider">|</span>
|
|
|
+ <span class="mobile-chapter-duration">{{ formatDuration(videoPathMap[chapter.id]?.courseTime || 0) }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mobile-chapter-play-icon">
|
|
|
+ <el-icon
|
|
|
+ v-if="currentChapterId === chapter.id && isPlaying"
|
|
|
+ class="playing-icon"
|
|
|
+ >
|
|
|
+ <div class="audio-wave">
|
|
|
+ <div class="wave-bar"></div>
|
|
|
+ <div class="wave-bar"></div>
|
|
|
+ <div class="wave-bar"></div>
|
|
|
+ </div>
|
|
|
+ </el-icon>
|
|
|
+ <el-icon
|
|
|
+ v-else
|
|
|
+ class="play-icon"
|
|
|
+ >
|
|
|
+ <CaretRight />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, computed, onMounted } from 'vue'
|
|
|
+import { useRouter, useRoute } from 'vue-router'
|
|
|
+import {
|
|
|
+ Lock,
|
|
|
+ Search,
|
|
|
+ ArrowLeftBold,
|
|
|
+ VideoPlay,
|
|
|
+ CaretRight,
|
|
|
+ Loading
|
|
|
+} from '@element-plus/icons-vue'
|
|
|
+import VideoPlayer from '@/components/videopage/VideoPlayer.vue'
|
|
|
+import leftImg from '@/assets/icon/backward.png'
|
|
|
+import rightImg from '@/assets/icon/f-backward.png'
|
|
|
+import classImages from '@/assets/icon/class.png'
|
|
|
+
|
|
|
+import { ClassType } from '@/api/class.js'
|
|
|
+import { Message } from '@/utils/message/Message.js'
|
|
|
+import { saveRecord } from '@/api/personalized/index.js'
|
|
|
+import { globalState } from '@/utils/globalState.js'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+const route = useRoute()
|
|
|
+
|
|
|
+const searchKeyword = ref('')
|
|
|
+const drawerVisible = ref(true)
|
|
|
+const currentChapterId = ref('')
|
|
|
+const isPlaying = ref(false)
|
|
|
+const isMobile = ref(false)
|
|
|
+const headerHidden = ref(false)
|
|
|
+
|
|
|
+const courseInfo = ref({
|
|
|
+ title: '',
|
|
|
+ subtitle: '',
|
|
|
+ coverImage: '',
|
|
|
+ progress: 0
|
|
|
+})
|
|
|
+
|
|
|
+// 跟踪是否处于全屏状态
|
|
|
+const isFullscreen = ref(false)
|
|
|
+
|
|
|
+const chapters = ref([])
|
|
|
+const videoPathMap = ref({})
|
|
|
+const gradeId = ref('')
|
|
|
+const typeId = ref('')
|
|
|
+const currentCourse = ref({})
|
|
|
+
|
|
|
+const chapterIds = computed(() => {
|
|
|
+ return chapters.value.map(c => c.id)
|
|
|
+})
|
|
|
+
|
|
|
+const filteredTitles = computed(() => {
|
|
|
+ if (!searchKeyword.value) {
|
|
|
+ return chapters.value
|
|
|
+ }
|
|
|
+ return chapters.value.filter(chapter =>
|
|
|
+ chapter.title.toLowerCase().includes(searchKeyword.value.toLowerCase())
|
|
|
+ )
|
|
|
+})
|
|
|
+
|
|
|
+const querySearch = (queryString, cb) => {
|
|
|
+ const results = queryString
|
|
|
+ ? chapters.value.filter(item => item.title.toLowerCase().includes(queryString.toLowerCase()))
|
|
|
+ : chapters.value
|
|
|
+ cb(results)
|
|
|
+}
|
|
|
+
|
|
|
+const handleSaveProgress = async (type, progress) => {
|
|
|
+ if (!progress) return
|
|
|
+ const saveProgressData = {
|
|
|
+ brpNjId: gradeId.value,
|
|
|
+ brpType: type,
|
|
|
+ brpProgress: progress,
|
|
|
+ brpCtId: typeId.value,
|
|
|
+ brpCourseId: currentCourse.value.id
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ await saveRecord(saveProgressData)
|
|
|
+ } catch (error) {
|
|
|
+ console.error('保存视频进度失败:', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const goBack = () => {
|
|
|
+ router.push('/ai-general-course')
|
|
|
+}
|
|
|
+
|
|
|
+const toggleDrawer = () => {
|
|
|
+ drawerVisible.value = !drawerVisible.value
|
|
|
+}
|
|
|
+
|
|
|
+const handleSelect = (index) => {
|
|
|
+ if (videoPathMap.value[index]) {
|
|
|
+ currentCourse.value = videoPathMap.value[index]
|
|
|
+ currentChapterId.value = index
|
|
|
+ drawerVisible.value = false
|
|
|
+ } else {
|
|
|
+ Message().notifyWarning('视频不存在!', true)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleSearchSelect = (item) => {
|
|
|
+ handleSelect(item.id)
|
|
|
+ searchKeyword.value = ''
|
|
|
+}
|
|
|
+
|
|
|
+const handleSearchSubmit = () => {
|
|
|
+ if (searchKeyword.value.trim()) {
|
|
|
+ // 可以在这里实现具体的搜索逻辑
|
|
|
+ console.log('搜索关键词:', searchKeyword.value)
|
|
|
+ // 例如:可以触发课程内容搜索、跳转到搜索结果页等
|
|
|
+ Message().success(`搜索: ${searchKeyword.value}`, true)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const playPreviousVideo = () => {
|
|
|
+ const currentIndex = chapterIds.value.indexOf(currentChapterId.value)
|
|
|
+ if (currentIndex > 0) {
|
|
|
+ handleSelect(chapterIds.value[currentIndex - 1])
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const playNextVideo = () => {
|
|
|
+ const currentIndex = chapterIds.value.indexOf(currentChapterId.value)
|
|
|
+ if (currentIndex !== -1 && currentIndex < chapterIds.value.length - 1) {
|
|
|
+ handleSelect(chapterIds.value[currentIndex + 1])
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const playChapter = (chapter) => {
|
|
|
+ handleSelect(chapter.id)
|
|
|
+ isPlaying.value = true
|
|
|
+}
|
|
|
+
|
|
|
+const togglePlay = () => {
|
|
|
+ isPlaying.value = !isPlaying.value
|
|
|
+}
|
|
|
+
|
|
|
+const onVideoPlay = () => {
|
|
|
+ isPlaying.value = true
|
|
|
+ // 视频播放时隐藏头部导航栏
|
|
|
+ headerHidden.value = true
|
|
|
+}
|
|
|
+
|
|
|
+const onVideoPause = () => {
|
|
|
+ isPlaying.value = false
|
|
|
+ // 视频暂停时显示头部导航栏
|
|
|
+ headerHidden.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const handlePageClick = () => {}
|
|
|
+
|
|
|
+const formatDuration = (seconds) => {
|
|
|
+ const mins = Math.floor(seconds / 60)
|
|
|
+ const secs = Math.floor(seconds % 60)
|
|
|
+ return `${mins.toString().padStart(2, '0')}分${secs.toString().padStart(2, '0')}秒`
|
|
|
+}
|
|
|
+
|
|
|
+const checkMobile = () => {
|
|
|
+ isMobile.value = window.innerWidth <= 768
|
|
|
+}
|
|
|
+
|
|
|
+// 检测设备方向变化
|
|
|
+const handleOrientationChange = () => {
|
|
|
+ // 延迟执行以确保获取正确的尺寸
|
|
|
+ setTimeout(() => {
|
|
|
+ checkMobile()
|
|
|
+ }, 100)
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ checkMobile()
|
|
|
+ window.addEventListener('resize', checkMobile)
|
|
|
+ // 监听设备方向变化
|
|
|
+ window.addEventListener('orientationchange', handleOrientationChange)
|
|
|
+
|
|
|
+ const typeIdParam = history.state?.typeId || router.currentRoute.value.query.typeId
|
|
|
+ if (typeIdParam) {
|
|
|
+ typeId.value = typeIdParam
|
|
|
+ try {
|
|
|
+ const res = await ClassType(typeIdParam)
|
|
|
+ const processedData = res.data.map(course => {
|
|
|
+ if (course.courseConfigList && Array.isArray(course.courseConfigList)) {
|
|
|
+ const validConfigList = course.courseConfigList.filter(config =>
|
|
|
+ config.ccTime !== undefined && config.ccTime !== null && config.ccTime > 0
|
|
|
+ )
|
|
|
+ return {
|
|
|
+ ...course,
|
|
|
+ courseConfigList: validConfigList
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return course
|
|
|
+ })
|
|
|
+
|
|
|
+ const videoCourses = processedData.filter(course => course.courseContentType === 'video')
|
|
|
+
|
|
|
+ videoCourses.forEach((course, index) => {
|
|
|
+ const menuIndex = String(index + 1).padStart(2, '0')
|
|
|
+ course.key = menuIndex
|
|
|
+ videoPathMap.value[menuIndex] = course
|
|
|
+
|
|
|
+ const menuItem = {
|
|
|
+ id: menuIndex,
|
|
|
+ key: menuIndex,
|
|
|
+ title: course.courseName
|
|
|
+ }
|
|
|
+ chapters.value.push(menuItem)
|
|
|
+
|
|
|
+ if (index === 0) {
|
|
|
+ currentCourse.value = course
|
|
|
+ currentChapterId.value = menuIndex
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取课程数据失败:', error)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const title = history.state?.typeName || router.currentRoute.value.query.typeName
|
|
|
+ if (title) {
|
|
|
+ courseInfo.value.title = String(title)
|
|
|
+ }
|
|
|
+
|
|
|
+ gradeId.value = globalState.initGradeId()
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+@use 'sass:math';
|
|
|
+
|
|
|
+@function rpx($px) {
|
|
|
+ @return math.div($px, 750) * 100vw;
|
|
|
+}
|
|
|
+
|
|
|
+/* ======================================== */
|
|
|
+/* 网页端样式 */
|
|
|
+/* ======================================== */
|
|
|
+.video-switch {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ margin-top: rpx(5);
|
|
|
+ margin-bottom: rpx(15);
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
+.caret-right,
|
|
|
+.caret-left {
|
|
|
+ width: rpx(50);
|
|
|
+ margin: 0 rpx(20);
|
|
|
+ margin: auto;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
+.caret-left ::v-deep(.el-button.is-round),
|
|
|
+.caret-right ::v-deep(.el-button.is-round) {
|
|
|
+ width: rpx(50);
|
|
|
+ height: rpx(15);
|
|
|
+ color: white;
|
|
|
+ font-size: rpx(7);
|
|
|
+ border-radius: none;
|
|
|
+ border: 1px white solid;
|
|
|
+ background-color: rgba(255, 255, 255, 0.5);
|
|
|
+ box-shadow: 0 4px 8px rgba(202, 52, 52, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.caret-right img,
|
|
|
+.caret-left img {
|
|
|
+ width: rpx(12);
|
|
|
+}
|
|
|
+
|
|
|
+.home-container ::v-deep(.el-drawer__body) {
|
|
|
+ width: rpx(135);
|
|
|
+ height: 100%;
|
|
|
+ position: relative;
|
|
|
+ background: linear-gradient(to bottom, #001169, #8a78d0);
|
|
|
+}
|
|
|
+
|
|
|
+.content-box {
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ background: linear-gradient(to bottom, #001169, #8a78d0);
|
|
|
+}
|
|
|
+
|
|
|
+.icon-expand {
|
|
|
+ width: rpx(8);
|
|
|
+ height: rpx(35);
|
|
|
+ border-top-right-radius: rpx(5);
|
|
|
+ border-bottom-right-radius: rpx(5);
|
|
|
+ z-index: 9999;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ cursor: pointer;
|
|
|
+ clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+}
|
|
|
+
|
|
|
+.icon-expand .vertical-lines {
|
|
|
+ color: #8a78d0;
|
|
|
+ font-size: rpx(10);
|
|
|
+}
|
|
|
+
|
|
|
+.home-container {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: linear-gradient(to bottom, #001169, #b4a8e1);
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.el-row {
|
|
|
+ margin: auto;
|
|
|
+ margin-top: rpx(20);
|
|
|
+}
|
|
|
+
|
|
|
+.tac ::v-deep(.el-menu) {
|
|
|
+ background-color: transparent;
|
|
|
+ border: none;
|
|
|
+ width: 100%;
|
|
|
+ margin-top: rpx(8);
|
|
|
+}
|
|
|
+
|
|
|
+.tac ::v-deep(.el-menu-item.is-active),
|
|
|
+.tac ::v-deep(.el-sub-menu__title.is-active) {
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+
|
|
|
+.tac ::v-deep(.el-sub-menu__title) {
|
|
|
+ width: rpx(130);
|
|
|
+ height: rpx(20);
|
|
|
+ margin-bottom: rpx(5);
|
|
|
+ border-radius: rpx(6);
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:hover),
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:focus),
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:active) {
|
|
|
+ background: linear-gradient(to bottom, #fee78a, #ffce1b);
|
|
|
+ background-color: transparent;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep(.el-sub-menu__icon-arrow) {
|
|
|
+ color: white;
|
|
|
+ font-size: rpx(10);
|
|
|
+ margin-left: auto;
|
|
|
+ margin-top: rpx(-5);
|
|
|
+ display: block;
|
|
|
+ width: rpx(16);
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:hover .el-sub-menu__icon-arrow) {
|
|
|
+ color: black;
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu ::v-deep(.el-icon svg) {
|
|
|
+ font-size: rpx(9);
|
|
|
+}
|
|
|
+
|
|
|
+.mb-2 {
|
|
|
+ color: white;
|
|
|
+ font-size: rpx(9);
|
|
|
+}
|
|
|
+
|
|
|
+.mb-2 img {
|
|
|
+ width: rpx(10);
|
|
|
+ height: rpx(10);
|
|
|
+ vertical-align: middle;
|
|
|
+ margin-top: rpx(-2);
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu-item {
|
|
|
+ width: rpx(100);
|
|
|
+ height: rpx(20);
|
|
|
+ margin-bottom: rpx(5);
|
|
|
+ border-radius: rpx(6);
|
|
|
+ color: white;
|
|
|
+ font-size: rpx(8);
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title) {
|
|
|
+ color: white;
|
|
|
+ width: rpx(100);
|
|
|
+ height: rpx(20);
|
|
|
+ margin-bottom: rpx(5);
|
|
|
+ font-size: rpx(8);
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:hover),
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:focus),
|
|
|
+.el-menu ::v-deep(.el-sub-menu__title:active) {
|
|
|
+ background: linear-gradient(to bottom, #fee78a, #ffce1b);
|
|
|
+ color: black;
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu ::v-deep(.el-menu-item:hover),
|
|
|
+.el-menu ::v-deep(.el-menu-item:focus),
|
|
|
+.el-menu ::v-deep(.el-menu-item:active) {
|
|
|
+ background: linear-gradient(to bottom, #fee78a, #ffce1b);
|
|
|
+ color: black;
|
|
|
+ font-size: rpx(8);
|
|
|
+ box-shadow: 0 4px 8px rgba(3, 3, 3, 0.3);
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu .el-menu-item.is-active {
|
|
|
+ background: linear-gradient(to bottom, #fee78a, #ffce1b);
|
|
|
+ color: black;
|
|
|
+ font-size: rpx(8);
|
|
|
+ box-shadow: 0 4px 8px rgba(3, 3, 3, 0.3);
|
|
|
+}
|
|
|
+
|
|
|
+.drawer-box {
|
|
|
+ position: absolute;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 100%;
|
|
|
+ width: 80%;
|
|
|
+}
|
|
|
+
|
|
|
+.box-1 {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: rpx(10);
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-size: rpx(15);
|
|
|
+}
|
|
|
+
|
|
|
+.inner-box {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: rpx(16);
|
|
|
+}
|
|
|
+
|
|
|
+.left-box {
|
|
|
+ position: relative;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: flex-start;
|
|
|
+ flex: 1;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.box-icon {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: rpx(5);
|
|
|
+ padding: rpx(5) rpx(10);
|
|
|
+ background-color: rgba(255, 255, 255, 80%);
|
|
|
+ border-radius: rpx(30);
|
|
|
+ backdrop-filter: blur(10px);
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+ font-size: rpx(8);
|
|
|
+ color: #333;
|
|
|
+ font-weight: 900;
|
|
|
+ width: fit-content;
|
|
|
+ margin-left: rpx(15);
|
|
|
+}
|
|
|
+
|
|
|
+.box-icon:hover {
|
|
|
+ background-color: rgba(255, 255, 255, 90%);
|
|
|
+ transform: translateX(-3px);
|
|
|
+}
|
|
|
+
|
|
|
+.left-icon {
|
|
|
+ font-size: rpx(10);
|
|
|
+}
|
|
|
+
|
|
|
+.right-box {
|
|
|
+ flex: 1;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.top-right-box {
|
|
|
+ position: absolute;
|
|
|
+ margin-left: rpx(260);
|
|
|
+ width: rpx(100);
|
|
|
+ margin-right: rpx(20);
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+
|
|
|
+ ::v-deep(.el-input__wrapper) {
|
|
|
+ height: rpx(15);
|
|
|
+ font-size: rpx(6);
|
|
|
+ background-color: rgba(255, 255, 255, 0.5);
|
|
|
+ border-radius: rpx(12);
|
|
|
+ border: white 1px solid;
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ ::v-deep(.el-input__icon) {
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ ::v-deep(.el-input__inner::placeholder) {
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ ::v-deep(.el-input__inner) {
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.search-input {
|
|
|
+ width: rpx(100);
|
|
|
+ height: rpx(15);
|
|
|
+ font-size: rpx(7);
|
|
|
+}
|
|
|
+
|
|
|
+.box-2 {
|
|
|
+ width: 100%;
|
|
|
+ flex: 1;
|
|
|
+ box-shadow: 0 4px 8px rgba(202, 52, 52, 0.1);
|
|
|
+ box-sizing: border-box;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-content: center;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.small-title {
|
|
|
+ width: 100%;
|
|
|
+ height: rpx(20);
|
|
|
+ color: white;
|
|
|
+ font-size: rpx(10);
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
+/* ======================================== */
|
|
|
+/* 视频播放器显示控制 */
|
|
|
+/* ======================================== */
|
|
|
+.web-video-player {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+.mobile-video-player {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+
|
|
|
+/* ======================================== */
|
|
|
+/* 手机端全局重置 */
|
|
|
+/* ======================================== */
|
|
|
+@media screen and (max-width: 768px) {
|
|
|
+ :deep(body),
|
|
|
+ :deep(html) {
|
|
|
+ margin: 0 !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ width: 100vw !important;
|
|
|
+ min-width: 100vw !important;
|
|
|
+ max-width: 100vw !important;
|
|
|
+ overflow-x: hidden !important;
|
|
|
+ box-sizing: border-box !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-container),
|
|
|
+ :deep(.el-header),
|
|
|
+ :deep(.el-main),
|
|
|
+ :deep(.el-footer) {
|
|
|
+ margin: 0 !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ width: 100vw !important;
|
|
|
+ min-width: 100vw !important;
|
|
|
+ max-width: 100vw !important;
|
|
|
+ box-sizing: border-box !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(#app),
|
|
|
+ :deep(.app-container),
|
|
|
+ :deep(.router-view),
|
|
|
+ :deep(.page-container) {
|
|
|
+ margin: 0 !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ width: 100vw !important;
|
|
|
+ min-width: 100vw !important;
|
|
|
+ max-width: 100vw !important;
|
|
|
+ box-sizing: border-box !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.video-container),
|
|
|
+ :deep(.video-wrapper),
|
|
|
+ :deep(.player-container) {
|
|
|
+ margin: 0 !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ width: 100% !important;
|
|
|
+ box-sizing: border-box !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/* ======================================== */
|
|
|
+/* 手机端样式 */
|
|
|
+/* ======================================== */
|
|
|
+.mobile-container {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+
|
|
|
+@media screen and (max-width: 768px) {
|
|
|
+ .web-video-player {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-video-player {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ .mobile-container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 100% !important;
|
|
|
+ min-width: 100% !important;
|
|
|
+ max-width: 100% !important;
|
|
|
+ min-height: 100vh;
|
|
|
+ background: #f5f5f5;
|
|
|
+ padding: 0 !important;
|
|
|
+ margin: 0 !important;
|
|
|
+ box-sizing: border-box !important;
|
|
|
+ position: fixed !important;
|
|
|
+ top: 0 !important;
|
|
|
+ left: 0 !important;
|
|
|
+ right: 0 !important;
|
|
|
+ bottom: 0 !important;
|
|
|
+ overflow-y: auto !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .home-container {
|
|
|
+ display: none !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-header {
|
|
|
+ width: 100% !important;
|
|
|
+ height: 44px;
|
|
|
+ background: linear-gradient(135deg, #44449c80, #7F70C880); /* 半透明背景 */
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 12px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: fixed; /* 固定定位,悬浮在顶部 */
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ z-index: 1000; /* 提高层级确保在最顶层 */
|
|
|
+ transition: transform 0.3s ease; /* 添加过渡动画 */
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-header.header-hidden {
|
|
|
+ transform: translateY(-100%); /* 向上隐藏 */
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-back-btn {
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgba(255, 255, 255, 0.2);
|
|
|
+ border-radius: 50%;
|
|
|
+ border: none;
|
|
|
+ color: white;
|
|
|
+ font-size: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-header-title {
|
|
|
+ flex: 1;
|
|
|
+ text-align: center;
|
|
|
+ color: white;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ padding: 0 40px;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-header-placeholder {
|
|
|
+ width: 32px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-video-area {
|
|
|
+ width: 100% !important;
|
|
|
+ min-width: 100% !important;
|
|
|
+ max-width: 100% !important;
|
|
|
+ height: auto !important;
|
|
|
+ background: #000;
|
|
|
+ margin-top: 44px; /* 为固定在顶部的导航栏预留空间 */
|
|
|
+ position: relative;
|
|
|
+ padding: 0 !important;
|
|
|
+ margin: 0 !important;
|
|
|
+ box-sizing: border-box !important;
|
|
|
+ flex-shrink: 0;
|
|
|
+ border-radius: 0 !important;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 手机端搜索框容器 */
|
|
|
+ .mobile-search-container {
|
|
|
+ width: 100%;
|
|
|
+ padding: rpx(16);
|
|
|
+ background: #f5f5f5;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-search-input {
|
|
|
+ width: 100%;
|
|
|
+ height: rpx(64);
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-search-input :deep(.el-input__wrapper) {
|
|
|
+ border-radius: rpx(32);
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: #fff;
|
|
|
+ border: none;
|
|
|
+ box-shadow: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-search-input :deep(.el-input__inner) {
|
|
|
+ height: 100%;
|
|
|
+ line-height: rpx(64);
|
|
|
+ font-size: rpx(28);
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 手机端视频播放器去圆角 */
|
|
|
+ @media screen and (max-width: 768px) {
|
|
|
+ .mobile-video-area :deep(.d-player-wrap),
|
|
|
+ .mobile-video-area :deep(.full-box-video),
|
|
|
+ .mobile-video-area :deep(.ppt-container) {
|
|
|
+ border-radius: 0 !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-video-area :deep(*) {
|
|
|
+ width: 100% !important;
|
|
|
+ height: 100% !important;
|
|
|
+ max-height: 100% !important;
|
|
|
+ object-fit: cover !important;
|
|
|
+ border-radius: 0 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-list {
|
|
|
+ flex: 1;
|
|
|
+ padding: 0;
|
|
|
+ background: #fff;
|
|
|
+ margin-top: rpx(10); /* 与视频信息区域分开 */
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-item {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 16px;
|
|
|
+ border-bottom: 1px solid #f0f0f0;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: background-color 0.2s ease;
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-item:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-item.active {
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-item.locked {
|
|
|
+ opacity: 0.6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-info {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-title-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ gap: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-number {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-title {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333;
|
|
|
+ line-height: 1.4;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-meta {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #999;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 8px;
|
|
|
+ padding-left: 28px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-type {
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-divider {
|
|
|
+ color: #ddd;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-duration {
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-play-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 12px;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-play-icon .el-icon {
|
|
|
+ font-size: 20px;
|
|
|
+ color: #409EFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-play-icon .playing-icon {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .audio-wave {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ gap: 2px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .wave-bar {
|
|
|
+ width: 2px;
|
|
|
+ height: 8px;
|
|
|
+ background-color: #409EFF;
|
|
|
+ border-radius: 1px;
|
|
|
+ animation: wave-animation 1.2s ease-in-out infinite;
|
|
|
+ }
|
|
|
+
|
|
|
+ .wave-bar:nth-child(1) {
|
|
|
+ animation-delay: 0s;
|
|
|
+ }
|
|
|
+
|
|
|
+ .wave-bar:nth-child(2) {
|
|
|
+ animation-delay: 0.2s;
|
|
|
+ }
|
|
|
+
|
|
|
+ .wave-bar:nth-child(3) {
|
|
|
+ animation-delay: 0.4s;
|
|
|
+ }
|
|
|
+
|
|
|
+ @keyframes wave-animation {
|
|
|
+ 0%, 100% {
|
|
|
+ transform: scaleY(1);
|
|
|
+ opacity: 0.7;
|
|
|
+ }
|
|
|
+ 50% {
|
|
|
+ transform: scaleY(1.8);
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-chapter-action {
|
|
|
+ width: 40px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mobile-lock-icon {
|
|
|
+ color: #ccc;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|