feat: 集成edu-core模块并重构课程详情页视频播放

- 添加edu-core本地依赖,用于视频播放组件
- 重构课程详情页,使用CourseVideo组件替换原有视频播放逻辑
- 优化课程列表页布局和样式,修复边框单位问题
- 更新manifest.json支持多方向屏幕旋转
This commit is contained in:
2026-02-09 10:29:59 +08:00
parent 671b7eb63d
commit 0e900d19be
33 changed files with 11533 additions and 98 deletions

View File

@@ -2,77 +2,36 @@
<view class="commonPageBox commonDetailPage" style="background-color: #fff">
<template v-show="!screenLoading">
<z-nav-bar title="教学内容"></z-nav-bar>
<CourseVideo
:video-list="videoArray"
:current-index="currentVideoIndex !== null ? currentVideoIndex : 0"
:course="{courseTitle:options.navTitle, chapterTitle: curriculumData.title}"
:http="$http"
/>
<view
class="contentBox curriculum_box"
:style="`height:calc(100% - ${60 + statusBarHeight}px !important;${
:style="`${
isFullScreen ? 'background:#000' : ''
}`"
>
<view
:style="`background:#000;height:200px;`"
v-if="videoArray.length > 0"
class="PM_font"
style="padding: 20rpx; font-size: 40rpx; color: #333"
>文章简介</view
>
<common-video
:isfresh="isfresh"
v-if="isfresh"
:secondCountDown="secondCountDown"
@handleFresh="handleFresh"
@changeScreen="changeScreen"
@changeScreenLoading="changeScreenLoading"
ref="commonVideo"
:currentVideoId="currentVideoId"
:currentVideoIndex="currentVideoIndex"
:curriculumData="{...curriculumData,curriculumImgUrl:options.curriculumImgUrl}"
>
</common-video>
<view style="color: #fff"></view>
<view class="scroll-view-item" style="padding-bottom: 80rpx;">
<common-rich-detail :detailInfo="{ ...curriculumData, title: '' }">
<image
v-if="curriculumData.imgUrl"
@click="previewImage(curriculumData.imgUrl)"
:src="curriculumData.imgUrl"
mode="widthFix"
class="headImage"
></image>
</common-rich-detail>
</view>
<scroll-view
scroll-y="true"
class="scroll-Y"
>
<view class="" style="padding: 20rpx; font-size: 34rpx; color: #333"
>课程{{ options.navTitle }}
</view>
<view style="padding: 20rpx; margin-bottom: 40rpx">
章节 {{ curriculumData.title }}
</view>
<view
v-if="videoArray.length > 0"
class="PM_font"
style="padding: 20rpx; font-size: 40rpx; color: #294a97"
>视频教学</view
>
<view class="scroll-view-item">
<common-curriculum-video
v-if="videoArray.length > 0"
:detailInfo="curriculumData"
:currentVideo="currentVideo"
:dataList="videoArray"
@open="changeVideo"
>
</common-curriculum-video>
</view>
<view
class="PM_font"
style="padding: 20rpx; font-size: 40rpx; color: #333"
>文章简介</view
>
<view class="scroll-view-item" style="padding-bottom: 80rpx;">
<common-rich-detail :detailInfo="{ ...curriculumData, title: '' }">
<image
v-if="curriculumData.imgUrl"
@click="previewImage(curriculumData.imgUrl)"
:src="curriculumData.imgUrl"
mode="widthFix"
class="headImage"
></image>
</common-rich-detail>
</view>
</scroll-view>
<p class="aui-text-danger">
本课程版权归天津众妙之门科技有限公司所有翻版必究!
</p>
@@ -96,6 +55,9 @@
<script>
import courseDescription from "@/pages/component/commonComponents/list";
import VideoPlayer from "edu-core/components/video-player";
import CourseVideo from "edu-core/components/course-video";
import AudioPlayer from "edu-core/src/components/audio-player";
import curriculumMp3 from "./mp3Detail.vue";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
@@ -103,6 +65,9 @@ export default {
components: {
courseDescription, //课程说明
curriculumMp3, //mp3
VideoPlayer, // 视频播放组件
AudioPlayer, // 音频播放组件
CourseVideo,
},
data() {
return {
@@ -123,6 +88,7 @@ export default {
options: {},
videoArrayHW: [],
videoArray: [],
videoListToPlayer: [],
relatedCoursesList: [], //相关课程
medicalCasesList: [], //相关医案
curriculumData: {},
@@ -203,9 +169,24 @@ export default {
},
},
methods: {
unlockChangeVideo() {},
changeScreenLoading(status) {
this.screenLoading = status;
},
initVideo() {
this.changeVideoLock = true
this.screenLoading = false;
this.isfresh = false;
this.$nextTick(() => {
this.isfresh = true;
// setTimeout(() => {
// this.$refs.commonVideo.init({
// currentVideo: this.currentVideo,
// currentVideoList: this.videoArray,
// });
// }, 200);
});
},
changeScreen(status) {
this.isFullScreen = status;
},
@@ -224,7 +205,7 @@ export default {
this.$nextTick(() => {
this.currentVideo = data;
this.currentVideoId = data.id;
this.initVideo()
this.isfresh = true;
});
}
@@ -245,6 +226,13 @@ export default {
},
};
},
// 将获取到的视频或音频列表转换为播放器需要的格式
convertToPlayerList() {
this.videoListToPlayer = this.videoArray.map((item) => ({
id: item.id,
recorPath: item.videoUrl,
}));
},
async getCourseDescriptionData() {
this.isfresh = false;
var data = {
@@ -263,10 +251,12 @@ export default {
.then(async (res) => {
that.curriculumData = res.data.detail;
that.videoArray = res.data.videos;
console.log('视频数据列表', that.videoArray)
if (that.videoArray.length > 0) {
that.convertToPlayerList();
that.currentVideo = that.videoArray[0];
that.currentVideoId = that.videoArray[0].id;
that.initVideo()
that.isfresh = true;
}
});
@@ -387,8 +377,6 @@ export default {
}
.contentBox {
height: 100vh;
.statusList {
padding: 10rpx;
box-sizing: border-box;