|
|
@@ -66,7 +66,7 @@
|
|
|
<CourseDirectory :info="info" ref="courseDirectory" :chapterId="chapterId" @purchaseFn="purchaseFn"/>
|
|
|
</div>
|
|
|
<div class=" bg_color_fff padding16 border_radius_16 box_shadow_card mt10" v-show="!isShowNote">
|
|
|
- <OtherCourse />
|
|
|
+ <OtherCourse :info="info"/>
|
|
|
</div>
|
|
|
<div class="isShowNote bg_color_fff padding16 border_radius_16 box_shadow_card mt10" v-show="isShowNote">
|
|
|
<div class="CloseBold" @click="isShowNote=false">
|
|
|
@@ -148,8 +148,11 @@ const purchaseFn = async (chapterId, chapterInfoItem={}) => {
|
|
|
isLoading.value = false;
|
|
|
if(res.code === 200){
|
|
|
if(res.data?.buyFlag == 1){
|
|
|
- currentVideoUrl.value = res.data?.contentUrl || ''
|
|
|
- // videoPlayer.value.initPlay();
|
|
|
+ currentVideoUrl.value = res.data?.contentUrl || '';
|
|
|
+ // 播放视频
|
|
|
+ // if (videoPlayer.value) {
|
|
|
+ // videoPlayer.value.initPlay();
|
|
|
+ // }
|
|
|
}else{
|
|
|
confirmBuy({
|
|
|
callback:purchaseFn,
|
|
|
@@ -232,36 +235,7 @@ const onPlayerReady = (player) => {
|
|
|
|
|
|
// 播放下一个视频
|
|
|
const playNextVideo = () => {
|
|
|
- if (!currentCourseChapters.value || currentPlayingVideoId.value === null) return
|
|
|
-
|
|
|
- // 查找当前播放视频的位置
|
|
|
- let currentIndex = -1
|
|
|
- let chapterIndex = -1
|
|
|
-
|
|
|
- for (let i = 0; i < currentCourseChapters.value.length; i++) {
|
|
|
- const chapter = currentCourseChapters.value[i]
|
|
|
- const index = chapter.videos.findIndex(v => v.id === currentPlayingVideoId.value)
|
|
|
-
|
|
|
- if (index !== -1) {
|
|
|
- chapterIndex = i
|
|
|
- currentIndex = index
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 如果找到当前视频
|
|
|
- if (chapterIndex !== -1 && currentIndex !== -1) {
|
|
|
- const currentChapter = currentCourseChapters.value[chapterIndex]
|
|
|
-
|
|
|
- // 如果当前章节还有下一个视频
|
|
|
- if (currentIndex < currentChapter.videos.length - 1) {
|
|
|
- playVideo(currentChapter.videos[currentIndex + 1])
|
|
|
- }
|
|
|
- // 如果是当前章节最后一个视频,且有下一个章节
|
|
|
- else if (chapterIndex < currentCourseChapters.value.length - 1) {
|
|
|
- playVideo(currentCourseChapters.value[chapterIndex + 1].videos[0])
|
|
|
- }
|
|
|
- }
|
|
|
+ console.log('播放下一个视频')
|
|
|
};
|
|
|
const collectFn = () => {
|
|
|
collect({objectId: courseId.value}).then(res => {
|