feat: 集成音频播放组件和视频播放器

This commit is contained in:
2026-02-11 14:49:16 +08:00
parent 9a92e6ffb4
commit c6feeeef8b
48 changed files with 15614 additions and 1584 deletions

View File

@@ -5,38 +5,13 @@
<!-- 页面内容 -->
<view class="page-content">
<!-- 视频播放器 -->
<view class="video-section">
<VideoPlayer
v-if="videoList.length > 0"
ref="videoPlayerRef"
v-model:current-index="currentVideoIndex"
:video-list="videoList"
:countdown-seconds="5"
/>
</view>
<!-- 课程和章节信息 -->
<view class="info-section">
<view class="info-item">
<text class="label">{{ $t('courseDetails.courseInfo') }}</text>
<text class="value">{{ courseTitle }}</text>
</view>
<view class="info-item">
<text class="label">{{ $t('courseDetails.chapterInfo') }}</text>
<text class="value">{{ chapterTitle }}</text>
</view>
</view>
<!-- 视频列表 -->
<view v-if="videoList.length > 0" class="video-list-section">
<view class="section-title">{{ $t('courseDetails.videoTeaching') }}</view>
<wd-radio-group v-model="currentVideoIndex" shape="button" >
<wd-radio v-for="(video, index) in videoList" :key="video.id" :value="index" class="mb-2!">
{{ video.type == 2 ? $t('courseDetails.audio') : $t('courseDetails.video') }}{{ index + 1 }}
</wd-radio>
</wd-radio-group>
</view>
<!-- 课程视频 -->
<AliPlayer
:video-list="videoList"
:current-index="currentVideoIndex !== null ? currentVideoIndex : 0"
:course="{courseTitle:courseTitle, chapterTitle: chapterTitle}"
:cover="curriculumImgUrl || ''"
/>
<!-- 选项卡 -->
<wd-tabs v-model="currentTab" class="tabs-section" lineWidth="30">
@@ -74,7 +49,7 @@
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { courseApi } from '@/api/modules/course'
import VideoPlayer from '@/components/video-player/index.vue'
import AliPlayer from '@/components/ali-video/index.vue'
import type { IChapterDetail } from '@/types/course'
import type { IVideoInfo } from '@/types/video'
@@ -82,6 +57,7 @@ import type { IVideoInfo } from '@/types/video'
const chapterId = ref<number>(0)
const courseTitle = ref('')
const chapterTitle = ref('')
const curriculumImgUrl = ref('')
// 页面数据
const chapterDetail = ref<IChapterDetail | null>(null)
@@ -100,6 +76,7 @@ onLoad((options: any) => {
chapterId.value = parseInt(options.id)
courseTitle.value = options.courseTitle || ''
chapterTitle.value = options.title || ''
curriculumImgUrl.value = options.curriculumImgUrl || ''
loadChapterDetail()
})

View File

@@ -236,7 +236,7 @@ const handleToDetail = (chapter: IChapter, catalogue: ICatalogue) => {
const noRecored = chapter.isAudition === 1 && catalogue.isBuy === 0 && !userVip.value
uni.navigateTo({
url: `/pages/course/details/chapter?id=${chapter.id}&courseId=${courseId.value}&courseTitle=${courseDetail.value?.title}&title=${chapter.title}&noRecored=${noRecored}`
url: `/pages/course/details/chapter?id=${chapter.id}&courseId=${courseId.value}&courseTitle=${courseDetail.value?.title}&title=${chapter.title}&noRecored=${noRecored}&curriculumImgUrl=${courseDetail.value?.image}`
})
}