feat: 集成edu-core视频组件并更新版本至2.0.38
- 添加edu-core依赖以使用标准化的课程视频组件 - 将本地common-video组件替换为edu-core的CommonCourseVideo - 重构章节详情页,移除原有的视频播放逻辑和倒计时功能 - 修复medicaldes页面样式问题,确保布局正确 - 在课程详情页传递课程封面图给视频组件 - 更新应用版本号至2.0.38
This commit is contained in:
6
main.js
6
main.js
@@ -88,8 +88,10 @@ import commonList from '@/pages/component/commonComponents/list.vue'
|
||||
Vue.component('common-list', commonList);
|
||||
import commonOrderSubmit from '@/pages/component/commonComponents/orderSubmit.vue'
|
||||
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'
|
||||
Vue.component('common-coupon', commonCoupon);
|
||||
import commonGoodsList from '@/pages/component/commonComponents/goodsList.vue'
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
"src" : "图片路径"
|
||||
}
|
||||
],
|
||||
"versionName" : "2.0.37",
|
||||
"versionCode" : 2037,
|
||||
"versionName" : "2.0.38",
|
||||
"versionCode" : 2038,
|
||||
"sassImplementationName" : "node-sass",
|
||||
"app-plus" : {
|
||||
"nvueCompiler" : "uni-app",
|
||||
|
||||
7489
package-lock.json
generated
7489
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@
|
||||
"dependencies": {
|
||||
"animate.css": "^4.1.1",
|
||||
"e-peanut": "file:",
|
||||
"edu-core": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.3",
|
||||
"element-plus": "^2.9.6",
|
||||
"epubjs": "^0.3.93",
|
||||
"jquery": "^2.2.4",
|
||||
|
||||
@@ -5,35 +5,23 @@
|
||||
<public-module></public-module>
|
||||
<template v-show="!screenLoading">
|
||||
<z-nav-bar title="教学内容"></z-nav-bar>
|
||||
<!-- <view class="contentBox curriculum_box" :style="`height:calc(100% - ${60 + statusBarHeight}px !important; -->
|
||||
<view class="contentBox curriculum_box" :style="`height:calc(100% - ${60 + statusBarHeight}px !important; width:100%; overflow-x: hidden; ${
|
||||
isFullScreen ? 'background:#000' : ''
|
||||
}`">
|
||||
<!-- 加密视频 -->
|
||||
<view style="background:#000; position: fixed; top: 120rpx; left: 0; width: 100%; z-index: 88;" v-if="videoArray.length>0">
|
||||
<common-video @changeScreen="changeScreen" @changeScreenLoading="changeScreenLoading"
|
||||
@hideNextVideo="hideNextVideo" @startNextVideoCountDown="startNextVideoCountDown"
|
||||
@unlockChangeVideo="unlockChangeVideo" v-if="isfresh " ref="commonVideo"
|
||||
:secondCountDown="secondCountDown" :videoTitle="curriculumData.title"
|
||||
:currentVideo="currentVideo" :noRecored="noRecored" :currentVideoList="videoArray">
|
||||
</common-video>
|
||||
<view style="height: 200px" v-else></view>
|
||||
</view>
|
||||
<!-- <scroll-view :style="`height:calc(100% - 200px - 40rpx) ;`" scroll-y="true" class="scroll-Y" style="background-color: #fff"> -->
|
||||
<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="contentBox curriculum_box"
|
||||
:style="`
|
||||
height:calc(100% - ${60 + statusBarHeight}px !important;
|
||||
width:100%;
|
||||
overflow-x: hidden; ${isFullScreen ? 'background:#000' : ''}
|
||||
`"
|
||||
>
|
||||
<!-- 课程视频及章节信息 -->
|
||||
<CommonCourseVideo
|
||||
:video-list="videoArray"
|
||||
:current-index="currentCateIndex !== null ? currentCateIndex : 0"
|
||||
:course="{courseTitle:options.navTitle, chapterTitle: curriculumData.title}"
|
||||
:cover="options.curriculumImgUrl || ''"
|
||||
:http="$http"
|
||||
/>
|
||||
|
||||
<view class="" style="border-top: 2px solid #2979ff;">
|
||||
<view class="coursePart flexbox" v-if="tabList.length > 1">
|
||||
<view :class="['item','flex_box',curTab == index ? 'active': '' ]"
|
||||
@@ -359,6 +347,12 @@
|
||||
methods: {
|
||||
editorIput(e){
|
||||
},
|
||||
hideNextVideo() {
|
||||
if (this.countDownTimer) {
|
||||
clearInterval(this.countDownTimer)
|
||||
this.countDownTimer = undefined
|
||||
}
|
||||
},
|
||||
moveHandle() {
|
||||
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) {
|
||||
@@ -713,44 +677,6 @@
|
||||
this.currentCateIndex = data.index;
|
||||
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() {
|
||||
this.show = false;
|
||||
},
|
||||
@@ -809,7 +735,7 @@
|
||||
.then(async (res) => {
|
||||
that.curriculumData = res.data.detail;
|
||||
that.videoArray = res.data.videos;
|
||||
console.log('视频列表:', that.videoArray);
|
||||
console.log('视频列表:', that.videoArray);
|
||||
//判断没有视频的情况
|
||||
if(that.videoArray.length==0){
|
||||
|
||||
@@ -826,9 +752,7 @@
|
||||
isHaveHistorySeekVideo != -1 ? isHaveHistorySeekVideo : 0;
|
||||
if (that.videoArray.length > 0) {
|
||||
this.currentVideo = that.videoArray[that.currentCateIndex];
|
||||
console.log('默认播放的index', that.currentCateIndex, this.currentVideo.id, that
|
||||
.videoArray);
|
||||
this.initVideo();
|
||||
console.log('默认播放的index', that.currentCateIndex, this.currentVideo.id, that.videoArray);
|
||||
}
|
||||
var videoArray = [];
|
||||
var videoArrayHW = [];
|
||||
@@ -1546,4 +1470,4 @@
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1062,12 +1062,12 @@
|
||||
v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ? noRecored = true : ''
|
||||
if(this.userVip){
|
||||
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{
|
||||
if(v.isAudition == 1||this.librayList[this.curIndex].isBuy == 1){
|
||||
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{
|
||||
if(this.librayList[this.curIndex].type != 0){
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
</view>
|
||||
<view :class="['titleItem']">{{item.name}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<u-divider text="暂无数据哦~" v-if="titleList.length==0"></u-divider>
|
||||
</view>
|
||||
@@ -644,6 +645,7 @@
|
||||
}
|
||||
|
||||
.contentBox {
|
||||
height: auto;
|
||||
.oneCateList {
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -694,6 +696,10 @@
|
||||
padding: 20rpx 10rpx;
|
||||
width: 100%;
|
||||
border-bottom: 0.5px solid #f8f9fa;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.wmzhimg {
|
||||
@@ -706,7 +712,7 @@
|
||||
|
||||
.container {
|
||||
padding: 10rpx;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@@ -763,4 +769,8 @@
|
||||
.chImage {
|
||||
height: 100rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
.android-bottom-space {
|
||||
height: 120rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user