feat: 集成edu-core视频组件并更新版本至2.0.38

- 添加edu-core依赖以使用标准化的课程视频组件
- 将本地common-video组件替换为edu-core的CommonCourseVideo
- 重构章节详情页,移除原有的视频播放逻辑和倒计时功能
- 修复medicaldes页面样式问题,确保布局正确
- 在课程详情页传递课程封面图给视频组件
- 更新应用版本号至2.0.38
This commit is contained in:
2026-02-10 12:34:15 +08:00
parent 5a4f96c195
commit e9d6f514bd
7 changed files with 7413 additions and 233 deletions

View File

@@ -88,8 +88,10 @@ import commonList from '@/pages/component/commonComponents/list.vue'
Vue.component('common-list', commonList); Vue.component('common-list', commonList);
import commonOrderSubmit from '@/pages/component/commonComponents/orderSubmit.vue' import commonOrderSubmit from '@/pages/component/commonComponents/orderSubmit.vue'
Vue.component('common-order-submit', commonOrderSubmit); Vue.component('common-order-submit', commonOrderSubmit);
import commonVideo from '@/pages/component/commonComponents/video/index.vue'
Vue.component('common-video', commonVideo); import CommonCourseVideo from 'edu-core/components/course-video'
Vue.component('CommonCourseVideo', CommonCourseVideo);
import commonCoupon from '@/pages/component/commonComponents/coupon/index.vue' import commonCoupon from '@/pages/component/commonComponents/coupon/index.vue'
Vue.component('common-coupon', commonCoupon); Vue.component('common-coupon', commonCoupon);
import commonGoodsList from '@/pages/component/commonComponents/goodsList.vue' import commonGoodsList from '@/pages/component/commonComponents/goodsList.vue'

View File

@@ -12,8 +12,8 @@
"src" : "图片路径" "src" : "图片路径"
} }
], ],
"versionName" : "2.0.37", "versionName" : "2.0.38",
"versionCode" : 2037, "versionCode" : 2038,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
"app-plus" : { "app-plus" : {
"nvueCompiler" : "uni-app", "nvueCompiler" : "uni-app",

7489
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,7 @@
"dependencies": { "dependencies": {
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"e-peanut": "file:", "e-peanut": "file:",
"edu-core": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.3",
"element-plus": "^2.9.6", "element-plus": "^2.9.6",
"epubjs": "^0.3.93", "epubjs": "^0.3.93",
"jquery": "^2.2.4", "jquery": "^2.2.4",

View File

@@ -5,35 +5,23 @@
<public-module></public-module> <public-module></public-module>
<template v-show="!screenLoading"> <template v-show="!screenLoading">
<z-nav-bar title="教学内容"></z-nav-bar> <z-nav-bar title="教学内容"></z-nav-bar>
<!-- <view class="contentBox curriculum_box" :style="`height:calc(100% - ${60 + statusBarHeight}px !important; --> <view
<view class="contentBox curriculum_box" :style="`height:calc(100% - ${60 + statusBarHeight}px !important; width:100%; overflow-x: hidden; ${ class="contentBox curriculum_box"
isFullScreen ? 'background:#000' : '' :style="`
}`"> height:calc(100% - ${60 + statusBarHeight}px !important;
<!-- 加密视频 --> width:100%;
<view style="background:#000; position: fixed; top: 120rpx; left: 0; width: 100%; z-index: 88;" v-if="videoArray.length>0"> overflow-x: hidden; ${isFullScreen ? 'background:#000' : ''}
<common-video @changeScreen="changeScreen" @changeScreenLoading="changeScreenLoading" `"
@hideNextVideo="hideNextVideo" @startNextVideoCountDown="startNextVideoCountDown" >
@unlockChangeVideo="unlockChangeVideo" v-if="isfresh " ref="commonVideo" <!-- 课程视频及章节信息 -->
:secondCountDown="secondCountDown"  :videoTitle="curriculumData.title" <CommonCourseVideo
:currentVideo="currentVideo" :noRecored="noRecored" :currentVideoList="videoArray"> :video-list="videoArray"
</common-video> :current-index="currentCateIndex !== null ? currentCateIndex : 0"
<view style="height: 200px" v-else></view> :course="{courseTitle:options.navTitle, chapterTitle: curriculumData.title}"
</view> :cover="options.curriculumImgUrl || ''"
<!-- <scroll-view :style="`height:calc(100% - 200px - 40rpx) ;`" scroll-y="true" class="scroll-Y" style="background-color: #fff"> --> :http="$http"
<view class="PM_font" style="padding: 20rpx; font-size: 40rpx; color: #2979ff;" :style="videoArray.length>0?'margin-top: 400rpx;':''" v-if="videoArray.length>0">视频教学 />
</view>
<view class="scroll-view-item" :style="videoArray.length==0?'margin-top: 20rpx;':''">
<view style="padding: 20rpx; font-size: 26rpx">
课程{{ options.navTitle }}
</view>
<view style="padding: 20rpx; margin-bottom: 40rpx; font-size: 26rpx">
章节{{ curriculumData.title }}
</view>
<common-curriculum-video v-if="videoArray && videoArray.length > 0" :detailInfo="curriculumData"
:currentVideo="currentVideo" :dataList="videoArray" @open="changeVideo"
:changeVideoLock="changeVideoLock">
</common-curriculum-video>
</view>
<view class="" style="border-top: 2px solid #2979ff;"> <view class="" style="border-top: 2px solid #2979ff;">
<view class="coursePart flexbox" v-if="tabList.length > 1"> <view class="coursePart flexbox" v-if="tabList.length > 1">
<view :class="['item','flex_box',curTab == index ? 'active': '' ]" <view :class="['item','flex_box',curTab == index ? 'active': '' ]"
@@ -359,6 +347,12 @@
methods: { methods: {
editorIput(e){ editorIput(e){
}, },
hideNextVideo() {
if (this.countDownTimer) {
clearInterval(this.countDownTimer)
this.countDownTimer = undefined
}
},
moveHandle() { moveHandle() {
return false; return false;
}, },
@@ -651,36 +645,6 @@
}) })
} }
}, },
unlockChangeVideo() {
this.changeVideoLock = false
},
startNextVideoCountDown() {
this.secondCountDown = 10
let that = this
if (this.countDownTimer) {
clearInterval(this.countDownTimer)
}
this.countDownTimer = setInterval(() => {
this.secondCountDown -= 1
if (this.secondCountDown == 0) {
// clearInterval(this.countDownTimer)
// console.log('倒计时结束');
that.hideNextVideo()
console.log('切换之前的播放index是', this.currentCateIndex);
// console.log('当前的播放列表',this.videoArray.length);
// if(this.currentCateIndex < this.videoArray.length-1){
this.currentCateIndex++
console.log('切换之后的播放index是', this.currentCateIndex);
that.changeVideo(this.videoArray[this.currentCateIndex])
// }
}
}, 1000)
},
hideNextVideo() {
console.log('父组件收到了取消加载-------------------');
clearInterval(this.countDownTimer)
this.countDownTimer = undefined
},
//课程详情 //课程详情
async gotoDetail(v, index) { async gotoDetail(v, index) {
@@ -713,44 +677,6 @@
this.currentCateIndex = data.index; this.currentCateIndex = data.index;
this.$forceUpdate(); this.$forceUpdate();
}, },
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);
});
},
changeVideo(data) {
this.changeVideoLock = true
if (this.countDownTimer) {
this.hideNextVideo()
}
console.log("点击了点击了切换视频-----:", this.countDownTimer, data, );
if (data.id != this.currentVideo.id) {
this.currentCateIndex = this.videoArray.findIndex(item => {
return item.id == data.id
})
// handleEnd
// this.$refs.commonVideo.handleEnd();
setTimeout(() => {
// this.$refs.commonVideo.changeVideo(data);
this.currentVideo = data;
this.initVideo();
this.isOpenMp3 = false;
}, 500);
}
},
hancleModalCancel() { hancleModalCancel() {
this.show = false; this.show = false;
}, },
@@ -809,7 +735,7 @@
.then(async (res) => { .then(async (res) => {
that.curriculumData = res.data.detail; that.curriculumData = res.data.detail;
that.videoArray = res.data.videos; that.videoArray = res.data.videos;
console.log('视频列表:', that.videoArray); console.log('视频列表', that.videoArray);
//判断没有视频的情况 //判断没有视频的情况
if(that.videoArray.length==0){ if(that.videoArray.length==0){
@@ -826,9 +752,7 @@
isHaveHistorySeekVideo != -1 ? isHaveHistorySeekVideo : 0; isHaveHistorySeekVideo != -1 ? isHaveHistorySeekVideo : 0;
if (that.videoArray.length > 0) { if (that.videoArray.length > 0) {
this.currentVideo = that.videoArray[that.currentCateIndex]; this.currentVideo = that.videoArray[that.currentCateIndex];
console.log('默认播放的index', that.currentCateIndex, this.currentVideo.id, that console.log('默认播放的index', that.currentCateIndex, this.currentVideo.id, that.videoArray);
.videoArray);
this.initVideo();
} }
var videoArray = []; var videoArray = [];
var videoArrayHW = []; var videoArrayHW = [];
@@ -1546,4 +1470,4 @@
justify-content: center; justify-content: center;
} }
} }
</style> </style>

View File

@@ -1062,12 +1062,12 @@
v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ? noRecored = true : '' v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ? noRecored = true : ''
if(this.userVip){ if(this.userVip){
uni.navigateTo({ uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`, url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}&curriculumImgUrl=${this.course.image}`,
}); });
}else{ }else{
if(v.isAudition == 1||this.librayList[this.curIndex].isBuy == 1){ if(v.isAudition == 1||this.librayList[this.curIndex].isBuy == 1){
uni.navigateTo({ uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`, url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}&curriculumImgUrl=${this.course.image}`,
}); });
}else{ }else{
if(this.librayList[this.curIndex].type != 0){ if(this.librayList[this.curIndex].type != 0){

View File

@@ -85,6 +85,7 @@
</view> </view>
<view :class="['titleItem']">{{item.name}}</view> <view :class="['titleItem']">{{item.name}}</view>
</view> </view>
</view> </view>
<u-divider text="暂无数据哦~" v-if="titleList.length==0"></u-divider> <u-divider text="暂无数据哦~" v-if="titleList.length==0"></u-divider>
</view> </view>
@@ -644,6 +645,7 @@
} }
.contentBox { .contentBox {
height: auto;
.oneCateList { .oneCateList {
justify-content: space-between; justify-content: space-between;
@@ -694,6 +696,10 @@
padding: 20rpx 10rpx; padding: 20rpx 10rpx;
width: 100%; width: 100%;
border-bottom: 0.5px solid #f8f9fa; border-bottom: 0.5px solid #f8f9fa;
&:last-child {
border-bottom: 0;
}
} }
.wmzhimg { .wmzhimg {
@@ -706,7 +712,7 @@
.container { .container {
padding: 10rpx; padding: 10rpx;
height: 100vh; min-height: 100vh;
background-color: #fff; background-color: #fff;
} }
@@ -763,4 +769,8 @@
.chImage { .chImage {
height: 100rpx; height: 100rpx;
} }
</style>
.android-bottom-space {
height: 120rpx;
}
</style>