feat: 集成edu-core模块并重构课程详情页视频播放
- 添加edu-core本地依赖,用于视频播放组件 - 重构课程详情页,使用CourseVideo组件替换原有视频播放逻辑 - 优化课程列表页布局和样式,修复边框单位问题 - 更新manifest.json支持多方向屏幕旋转
This commit is contained in:
@@ -571,8 +571,8 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
border-top: 2rpx solid #eee;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
// background-color: #fff;
|
||||
// box-shadow: 0 1px 8px #e3e1e1;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -58,35 +58,36 @@
|
||||
<text style="font-weight: blod" class="catalogue_title">{{ slotProps.data.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="not_purchased" v-if="slotProps.data.type != 0&&!showNewPayBtn[slotProps.index].status">
|
||||
<view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<view v-if="slotProps.data.type != 0&&!showNewPayBtn[slotProps.index].status" class="not_purchased">
|
||||
<view v-if="!userVip">
|
||||
<text v-if="slotProps.data.isBuy!=1">未购买</text>
|
||||
<view v-if="slotProps.data.isBuy==1">
|
||||
<text v-if="slotProps.data.endTime" style=" width: 280rpx; margin: 0;">课程有效期截止到:<br/>{{slotProps.data.endTime}} </text>
|
||||
<text v-if="slotProps.data.endTime" style=" width: 300rpx; margin: 0;">课程有效期截止到:<br/>{{slotProps.data.endTime}}111</text>
|
||||
<text v-else>已购买</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view v-if="slotProps.data.isBuy==1">
|
||||
<text v-if="slotProps.data.endTime" style=" width: 280rpx; margin: 0;">课程有效期截止到:<br/>{{slotProps.data.endTime}} </text>
|
||||
<text v-if="slotProps.data.endTime" style=" width: 300rpx; margin: 0;">课程有效期截止到:<br/>{{slotProps.data.endTime}}222</text>
|
||||
<text v-else>已购买</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text v-if="slotProps.data.type == 0&&!userVip&&slotProps.data.isBuy!=1" style="color: #fff; font-size: 12px" class="fdButtonBox aui-text-success"
|
||||
@click="handleClickGetGoodsList(slotProps.data)">领取课程</text>
|
||||
|
||||
<text v-if="showNewPayBtn[slotProps.index]&&showNewPayBtn[slotProps.index].status" style=" background: #f42c32; border: 0; padding: 15rpx 30rpx; color: #fff; font-size: 12px" class="fdButtonBox aui-text-success"
|
||||
@click="goNewPay(slotProps.data)">复读</text>
|
||||
|
||||
<u-icon v-if="!userVip&&slotProps.data.type != 0&&slotProps.data.isBuy!=1&&!showNewPayBtn[slotProps.index].status"
|
||||
@click="handleClickGetGoodsList(slotProps.data)" class="editIcon" name="shopping-cart-fill"
|
||||
color="#FF2B57" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="right">
|
||||
<text v-if="slotProps.data.type == 0&&!userVip&&slotProps.data.isBuy!=1" style="color: #fff; font-size: 12px" class="fdButtonBox aui-text-success"
|
||||
@click="handleClickGetGoodsList(slotProps.data)">领取课程</text>
|
||||
|
||||
<text v-if="showNewPayBtn[slotProps.index]&&showNewPayBtn[slotProps.index].status" style=" background: #f42c32; border: 0; padding: 15rpx 30rpx; color: #fff; font-size: 12px" class="fdButtonBox aui-text-success"
|
||||
@click="goNewPay(slotProps.data)">复读</text>
|
||||
|
||||
<u-icon v-if="!userVip&&slotProps.data.type != 0&&slotProps.data.isBuy!=1&&!showNewPayBtn[slotProps.index].status"
|
||||
@click="handleClickGetGoodsList(slotProps.data)" class="editIcon" name="shopping-cart-fill"
|
||||
color="#FF2B57" size="28"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -760,6 +761,8 @@
|
||||
line-height: 30rpx !important;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.fdButtonBoxRed {
|
||||
@@ -858,7 +861,6 @@
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 4rpx solid #fff;
|
||||
|
||||
.top_item {
|
||||
@@ -1155,6 +1157,7 @@
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 4rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.chapter_content {
|
||||
@@ -1224,21 +1227,25 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.right {
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
// position: absolute;
|
||||
// left: 100%;
|
||||
// top: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
.not_purchased {
|
||||
position: relative;
|
||||
margin-left: 20rpx;
|
||||
white-space: nowrap;
|
||||
|
||||
.spot {
|
||||
width: 8rpx;
|
||||
|
||||
@@ -292,7 +292,7 @@ export default {
|
||||
margin: 0 30rpx 20rpx;
|
||||
}
|
||||
.doctors_item {
|
||||
border: 1rpx solid $themeColor;
|
||||
border: 1px solid $themeColor;
|
||||
border-radius: 15rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 25rpx 25rpx 60rpx;
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
@scrolltolower="loadMore"
|
||||
:style="`
|
||||
height: calc(100vh - ${activeTab == 0 ? 320 : 180}rpx);
|
||||
margin-top: ${activeTab == 0 ? 260 : 80}rpx;
|
||||
margin-top: ${activeTab == 0 ? 270 : 80}rpx;
|
||||
padding-bottom: 140rpx;`"
|
||||
v-if="show == true"
|
||||
>
|
||||
@@ -813,7 +813,7 @@ readArticle(item){
|
||||
margin: 0 20rpx 20rpx;
|
||||
}
|
||||
.doctors_item {
|
||||
border: 1rpx solid $themeColor;
|
||||
border: 1px solid $themeColor;
|
||||
border-radius: 15rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 25rpx 25rpx 60rpx;
|
||||
|
||||
@@ -373,8 +373,8 @@ export default {
|
||||
title: '加载中'
|
||||
})
|
||||
var data = {
|
||||
type: "vip",
|
||||
qudao: "google",
|
||||
type: "point",
|
||||
qudao: "Android",
|
||||
};
|
||||
$http.request({
|
||||
url: this.urlList.list,
|
||||
|
||||
Reference in New Issue
Block a user