feat(video): 集成 edu-core 视频组件并更新应用配置

- 添加 edu-core 依赖以替换原有视频播放功能
- 升级应用版本至 1.0.51
- 在课程详情页中使用 CommonCourseVideo 组件
- 移除原有的视频播放逻辑和冗余代码
This commit is contained in:
2026-02-10 11:43:36 +08:00
parent bd23758d1b
commit f705e1d0c6
5 changed files with 180 additions and 376 deletions

View File

@@ -9,215 +9,36 @@
isFullScreen ? 'background:#000' : ''
}`"
>
<view
:style="`background:#000;height:200px;`"
v-if="videoArray.length > 0"
>
<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>
<CommonCourseVideo
:video-list="videoArray"
:current-index="currentVideoIndex !== null ? currentVideoIndex : 0"
:course="{courseTitle:options.navTitle, chapterTitle: curriculumData.title}"
:cover="options.curriculumImgUrl || ''"
:http="$http"
/>
<scroll-view
:style="`height:calc(100% - ${
videoArray.length > 0 ? 200 : 1
}px - 40rpx) ;`"
scroll-y="true"
class="scroll-Y"
style="background-color: #fff"
>
<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: #3ab3ae"
>视频教学</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">
<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" style="text-align: center">
本课程版权归天津众妙之门科技有限公司所有翻版必究!
</p>
<!-- <view class="small_class_teaching_box" v-if="medicalCasesList.length > 0">
<view class="small_class_teaching_top">
<view class="small_class_teaching_top_left">
<image
src="@/static/icon/course_ic.png"
mode="aspectFil"
class="icon1"
></image>
<text>相关医案</text>
</view>
</view>
<view class="small_class_teaching_content"> </view>
</view>
<view
class="small_class_teaching_box related_courses_box"
v-if="relatedCoursesList.length > 0"
>
<view class="small_class_teaching_top">
<view class="small_class_teaching_top_left">
<image
src="@/static/icon/course_ic.png"
mode="aspectFil"
class="icon1"
></image>
<text>相关课程</text>
</view>
</view>
<view class="small_class_teaching_content">
<common-curriculum-list
imgUrl="url"
:isCondition="true"
:dataList="relatedCoursesList"
@hancleClick="goCourseDescription"
label="title"
>
<template slot="labelSlot" slot-scope="slotProps">
<view class="related_courses_name hidden1">{{
slotProps.row.title
}}</view>
</template>
<template slot="rightSlot" slot-scope="slotProps">
<text class="aui-text-danger">
{{ slotProps.row.courseFee }}</text
>
<view> </view>
</template>
</common-curriculum-list>
</view>
</view>
<view
class="small_class_teaching_box correlation_box"
v-for="(v, i) in correlationiList"
>
<view class="small_class_teaching_top">
<view class="small_class_teaching_top_left">
<template v-if="v.iconType == 'uni'">
<uni-icons
:type="v.icon"
:color="v.color ? v.color : '#71d5a1'"
:size="v.iconSize"
style="display: inline-block; margin-right: 10rpx"
></uni-icons>
</template>
<template v-else>
<u-icon
:name="v.icon"
:color="v.color ? v.color : '#71d5a1'"
:size="v.iconSize"
style="display: inline-block; margin-right: 10rpx"
></u-icon>
</template>
<text
:style="`color:${v.color ? v.color : '#71d5a1'}`"
class="title"
>{{ v.name }}</text
>
</view>
<view class="small_class_teaching_top_right"
><text
:style="`color:#b0b0b0`"
class="more"
@click="handleClickMore(v, i, true)"
v-show="!v.isOpen"
v-if="v.type != 'dashang'"
>查看全部</text
>
</view>
</view>
<view
:class="`small_class_teaching_content dianzan_box ${
v.isOpen ? '' : 'hidden5'
}`"
v-if="v.type == 'dianzan'"
>
{{ praise }}
</view>
<view
:class="`small_class_teaching_content dianzan_box ${
v.isOpen ? '' : 'hidden5'
}`"
v-if="v.type == 'pinglun'"
>
<view v-for="(item, index) in commentLst">
<text>{{ item.name }}:</text>
<text>{{ item.content }}</text>
</view>
</view>
<view
:class="`small_class_teaching_content dianzan_box dashang_box ${
v.isOpen ? '' : 'hidden5'
}`"
v-if="v.type == 'dashang'"
>
<rich-text :nodes="reward"></rich-text>
</view>
<view
@click="handleClickMore(v, i, false)"
class="close"
v-show="v.isOpen"
>收起
<u-icon
name="arrow-up"
color="#b0b0b0"
size="18"
style="display: inline-block; margin-left: 10rpx"
></u-icon>
</view>
</view> -->
<view
class="PM_font"
style="padding: 20rpx; font-size: 40rpx; color: #333"
>文章简介</view
>
<view class="scroll-view-item">
<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>
<view class="copyright">
<p class="aui-text-danger" style="text-align: center">
本课程版权归天津众妙之门科技有限公司所有翻版必究!
</p>
<view class="place-height"></view>
</view>
</view>
</template>
@@ -349,66 +170,6 @@ export default {
},
},
methods: {
changeScreenLoading(status) {
this.screenLoading = status;
},
changeScreen(status) {
this.isFullScreen = status;
},
ordersTabCLi(data) {
console.log("i at line 312:", data);
this.currentCateIndex = data.index;
this.$forceUpdate();
},
handleFresh(status) {
this.isfresh = status;
// this.currentVideoId = this.currentSelectVideoId;
// console.log("this.currentVideoId", this.currentVideoId);
this.$forceUpdate();
},
changeVideo(data) {
if (data.id != this.currentVideo.id) {
this.isfresh = false;
this.$nextTick(() => {
// this.$refs.commonVideo.destory();
// if (data.id != this.currentVideoId) {
this.currentVideo = data;
this.currentVideoId = data.id;
this.isfresh = true;
// }
});
}
},
hancleModalCancel() {
this.show = false;
},
handleClickMore(v, i, status) {
this.$set(this.correlationiList[i], "isOpen", status);
},
hancleModalConfirm() {
var data = {
values: {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
...this.taiHuClassInfo,
},
};
},
//课程详情
gotoDetail(v) {
uni.navigateTo({
url: `/pages/curriculum/order/curriculum/detail?navTitle=${v.title}&title=${v.title}&oid=${v.oid}`,
});
},
//相关课程
goCourseDescription(v) {
uni.navigateTo({
url: `/pages/curriculum/order/curriculum/index?navTitle=${v.title}&title=${v.title}&id=${v.id}`,
});
},
async getCourseDescriptionData() {
this.isfresh = false;
var data = {
@@ -436,87 +197,6 @@ export default {
}
});
},
getPriceData() {
var that = this;
setTimeout(() => {
that.$nextTick(() => {
that.$refs.priceDetail.getData();
});
}, 100);
},
// 检查是有权限使用搜索功能
checkDisable() {},
// 获取用户详情
getUserInfo() {
// 用户详情
if (this.userInfo.id != undefined) {
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
this.userMes = res.user;
this.getCateList();
});
}
},
async handleselectCate(item, index) {
this.dataList = [];
var data = [];
var that = this;
this.$http
.post(this.urlList.curriculumInfo, {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
oid: item.coid,
})
.then(async (res) => {
that.curriculumInfo = res.obj;
that.dataList = res.obj.courseList;
// socket.init();
});
this.searchValue = "";
this.searchList = [];
this.showSearchList = false;
return data;
},
async setOneCateIndex(item, index) {
this.allDataList = [];
var that = this;
this.currentStatusIndex = index;
this.searchValue = "";
this.searchList = [];
this.showSearchList = false;
this.$nextTick(async () => {
await that.getCourseDescriptionData();
this.$forceUpdate();
});
},
transformData(inputData) {
const result = {};
inputData.forEach((item) => {
const { letter } = item;
if (!result[letter]) {
result[letter] = [];
}
result[letter].push(item);
});
// const finalResult = Object.keys(result).map(key => ({ [key]: result[key] }));
return result;
},
getCateList(id) {
id ? "" : (id = 0);
this.twoCateList = [];
this.curTwoCateIndex = 0;
},
// 放大图片
previewImage(url) {
uni.previewImage({
@@ -876,11 +556,23 @@ export default {
.related_courses_name {
display: inline-block;
width: calc(100% - 150rpx) !important;
.aui-text-danger {
display: inline-block;
float: right;
}
}
.copyright {
.aui-text-danger {
position: fixed;
z-index: 99;
width: 100%;
bottom: 0;
left: 0;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
background-color: #F8F9FA;
}
.place-height {
height: 40px;
}
}
.curriculum_box {