课程说明未完成

This commit is contained in:
@fawn-nine
2024-06-20 17:04:17 +08:00
parent 910a546584
commit 2523845927
8 changed files with 718 additions and 211 deletions

View File

@@ -22,7 +22,7 @@ Vue.prototype.$getHours = nowHour
Vue.prototype.$baseUrl = "https://api.nuttyreading.com/" Vue.prototype.$baseUrl = "https://api.nuttyreading.com/"
// 安卓安卓包下载地址 // 安卓安卓包下载地址
// Vue.prototype.$apkUrl = "https://www.nuttyreading.com/nuttyreading.apk" // 本地地址 // Vue.prototype.$apkUrl = "https://www.nuttyreading.com/nuttyreading.apk" // 本地地址
Vue.prototype.$apkUrl = "https://a.app.qq.com/o/simple.jsp?pkgname=com.cn.nuttyreading" // 应用宝 Vue.prototype.$apkUrl = "https://a.app.qq.com/o/simple.jsp?pkgname=com.cn.medicine" // 应用宝
// 判断手机型号 // 判断手机型号

View File

@@ -1,7 +1,7 @@
{ {
// "easycom": { "easycom": {
// "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
// }, },
"pages": [ "pages": [
{ {
"path": "pages/peanut/home", "path": "pages/peanut/home",

View File

@@ -16,16 +16,7 @@
ref="videoContent" ref="videoContent"
@tap="renderScript.handleClick" @tap="renderScript.handleClick"
id="url-player-test" id="url-player-test"
:videoData="videoData" :videoData="videoData"
:winWidth="winWidth"
:winHeight="winHeight"
:currentVideoList="currentVideoList"
:firstTime="firstTime"
:change:videoData="renderScript.receiveMsg"
:change:winWidth="renderScript.receiveWinWidth"
:change:winHeight="renderScript.receiveWinHeight"
:change:firstTime="renderScript.receiveFirstTime"
:change:currentVideoList="renderScript.receiveVideoList"
></div> ></div>
<div @tap="renderScript.emitData" ref="videoContent1" v-show="false"> <div @tap="renderScript.emitData" ref="videoContent1" v-show="false">
直接调用renderjs中的emitData的方法,传递当前播放时长 直接调用renderjs中的emitData的方法,传递当前播放时长
@@ -152,7 +143,7 @@ export default {
this.options = JSON.parse(options.data); this.options = JSON.parse(options.data);
this.videoId = this.options.video; this.videoId = this.options.id;
this.timer = setInterval(() => { this.timer = setInterval(() => {
var that = this; var that = this;
@@ -212,7 +203,7 @@ export default {
} }
this.options = data.currentVideo; this.options = data.currentVideo;
console.log("this.options at line 64:", this.options); console.log("this.options at line 64:", this.options);
this.videoId = this.options.video; this.videoId = this.options.id;
this.timer = setInterval(async () => { this.timer = setInterval(async () => {
var that = this; var that = this;
if (this.currentTime) { if (this.currentTime) {
@@ -297,13 +288,14 @@ export default {
}, },
// 获取数据 // 获取数据
getLive() { getLive() {
console.log(this.options,'----------------11111111111111--------')
var data = { var data = {
...this.options, ...this.options,
}; };
console.log(data,'------------------------')
$http $http
.request({ .request({
url: `sociology/course/checkVideo`, url: "medical/course/checkVideoByMD",
method: "Post", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "Post", // POST、GET、PUT、DELETE具体说明查看官方文档
data, data,
header: { header: {
@@ -313,22 +305,23 @@ export default {
}) })
.then((res) => { .then((res) => {
console.log("res at line 252111111111111111111111111111:", res); console.log("res at line 252111111111111111111111111111:", res);
if (this.currentVideo.type == 1) { if (this.currentVideo.type == 1) {
var playAuth = res.video.playAuth.replace(/=/g, ""); var playAuth = res.playAuth.replace(/=/g, "");
this.videoData = { this.videoData = {
...res.video, ...res,
videoId: res.video.video, video: res.id,
playAuth: playAuth, playAuth: playAuth,
}; };
this.playAuth = playAuth; this.playAuth = playAuth;
} else { } else {
this.videoData = res.video; // this.videoData = res.video;
this.videoUrl = // this.videoUrl =
// "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/" + // // "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/" +
res.video.videoUrl; // res.video.videoUrl;
this.$nextTick(async () => { // this.$nextTick(async () => {
await this.getData(); // await this.getData();
}); // });
} }
this.$forceUpdate(); this.$forceUpdate();
@@ -505,6 +498,9 @@ this.player.fullscreenService.requestFullScreen();
ownerInstance.callMethod('handleEnd', ) ownerInstance.callMethod('handleEnd', )
}, },
getLive() { getLive() {
console.log(this.videoData,'走没走。。。。。。。。。。')
if(this.videoData.type==1){ if(this.videoData.type==1){
var fullScreenButtonComponent = Aliplayer.Component({ var fullScreenButtonComponent = Aliplayer.Component({
/** /**
@@ -732,15 +728,15 @@ this.player.on('ended', function() {
// console.log('vm', vm) // console.log('vm', vm)
}, },
checkValue() { checkValue() {
console.log(this.videoId, this.authId, "1111888888") console.log(this.videoId, this.videoData, "1111888888")
if (!this.videoData.playAuth||!this.currentVideoList) { if (!this.videoData.playAuth) {
setTimeout(() => { setTimeout(() => {
this.checkValue(); this.checkValue();
}, 1000); }, 1000);
} else { } else {
console.log('this.videoList at line 这是这只只是594:', this.currentVideoList)
this.getLive(); this.getLive();console.log('this.videoList at line 这是这只只是594:',this.videoData)
} }
}, },
loadWebPlayerSDK() { loadWebPlayerSDK() {

View File

@@ -591,12 +591,12 @@
}, },
// 查询课程的评论 // 查询课程的评论
getSayList() { getSayList() {
this.status = 1
if (this.loadFlag) { if (this.loadFlag) {
console.log('有未完成的进程'); console.log('有未完成的进程');
return return
} }
this.loadFlag = true this.loadFlag = true
this.status = 1
$http.request({ $http.request({
url: "common/courseGuestbook/getCourseGuestbookList", url: "common/courseGuestbook/getCourseGuestbookList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档

View File

@@ -18,34 +18,48 @@
<view class="tabLeve2 subItem flexbox" v-if="Leve2.length > 0"> <view class="tabLeve2 subItem flexbox" v-if="Leve2.length > 0">
<text :class="[leve2Index == index ? 'cur' : '']" v-for="(item, index) in Leve2" :key="index" <text :class="[leve2Index == index ? 'cur' : '']" v-for="(item, index) in Leve2" :key="index"
@click="leve2Click(item, index)">{{item.title}}</text> @click="leve2Click(item, index)">{{item.title}}</text>
</view>
<!-- {{leve3store}}
<pre>
{{Leve3.length}}
</pre> -->
<view class="tabLeve3 subItem flexbox" v-if="leve3store.length > 0 && Leve3.length == 0">
<text :class="[leve3Index == index ? 'cur' : '']" v-for="(item, index) in leve3store" :key="index"
@click="leve3Click(item, index,leve3store)">{{item.title}}</text>
</view> </view>
<view class="tabLeve3 subItem flexbox" v-if="Leve3.length > 0"> <view class="tabLeve3 subItem flexbox" v-if="Leve3.length > 0">
<text :class="[leve3Index == index ? 'cur' : '']" v-for="(item, index) in Leve3" :key="index" <text :class="[leve3Index == index ? 'cur' : '']" v-for="(item, index) in Leve3" :key="index"
@click="leve3Click(item, index)">{{item.title}}</text> @click="leve3Click(item, index)">{{item.title}}</text>
</view> </view>
<view class="containerBg"> <view class="" v-if="courseInfo.content == '' && courseInfo.media == ''">
<u-divider text="本门课程没有编写课程说明"></u-divider>
</view>
<view class="containerBg" v-else>
<view class="infoBox" v-if="courseInfo.id"> <view class="infoBox" v-if="courseInfo.id">
<uni-section :title="courseTitle" type="line" titleFontSize="16px"> <uni-section :title="courseTitle" type="line" titleFontSize="16px">
<view class="audio" style="margin-bottom: 20rpx;" <view class="audio" style="margin-bottom: 20rpx;"
v-if="courseInfo.mediaType == 2 && courseInfo.media != ''"> v-if="courseInfo.mediaType == 2 && courseInfo.media != ''">
<audio style="text-align: left" :src="courseInfo.media" :poster="audioPoster" <audio style="text-align: left" :src="courseInfo.media" :poster="audioPoster"
:name="courseTitle" author="吴门医述" :action="audioAction" controls></audio> :name="courseTitle" author="吴门医述" :action="audioAction" controls></audio>
</view> </view>
<view> <view style="margin-top: 50px;">
<!-- <view v-if="courseInfo.mediaType ==1 && courseInfo.media != ''" style="width: 100%;height: 100%;text-align: center;" v-html="videoHTML"> <view class="container" v-if="courseInfo.mediaType ==1 && courseInfo.media != ''">
</view> -->
<!-- <view class="container" >
<div ref="videoContent" @tap="renderScript.handleClick" id="url-player-test" <div ref="videoContent" @tap="renderScript.handleClick" id="url-player-test"
:videoData="videoData" :change:videoData="renderScript.receiveMsg"></div> :videoData="videoData"
</view> --> :change:videoData="renderScript.receiveMsg"></div>
</view>
<!-- {{videoData}} --> <!-- {{videoData}} -->
</view> </view>
<!-- <rich-text v-if="courseInfo.content" class="content" <!-- <div class="fullScreenButton-container">
:nodes="formatRichText(courseInfo.content)"></rich-text> --> <div
<!-- <text>超强树选择器树组件树插件无限级联树单选树多选树自定义样式树树形选择 </text> --> :class="`prism-fullscreen-btn ${isFullScreen ? 'fullscreen' : ''}`"
@tap="renderScript.changeVideoScreen"
></div>
<!-- <img class=" iconfont icon-list" src="../../../../static/icon/cate_bg.png" style="width: 60px;height: 10px;"></img> -->
<!-- </div> -->
<rich-text v-if="courseInfo.content" class="content"
:nodes="formatRichText(courseInfo.content)"></rich-text>
</uni-section> </uni-section>
</view> </view>
</view> </view>
@@ -65,11 +79,12 @@
data() { data() {
return { return {
playData: {}, playData: {},
// destroyPlayer:false,
Leve1: [], Leve1: [],
Leve2: [], Leve2: [],
Leve3: [], Leve3: [],
accordionVal: '', accordionVal: '',
options: {},//上个页面获取的视频参数视频id options: {}, //上个页面获取的视频参数视频id
playAuth: "", //播放凭证 playAuth: "", //播放凭证
videoId: "", //阿里云视频id videoId: "", //阿里云视频id
videoData: {}, //阿里云视频其他参数 videoData: {}, //阿里云视频其他参数
@@ -116,6 +131,7 @@
audioAction: { audioAction: {
method: 'pause' method: 'pause'
}, },
leve3store:[],
curId: null, curId: null,
courseTitle: '', courseTitle: '',
showTemp: true, showTemp: true,
@@ -152,36 +168,49 @@
// #endif // #endif
this.showTemp = true this.showTemp = true
this.videoContext = null this.videoContext = null
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
components: { components: {
// musicPlay // musicPlay
// commonVideo
}, },
created() { created() {
// this.getLive();//获取播放凭证 // this.getLive();//获取播放凭证
}, },
//方法 //方法
methods: { methods: {
// 获取数据 // 获取数据
getLive(playAuthsss) { getLive(playAuthsss) {
//playAuth 是播放凭证 通过后端自己根据api去获取返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放 //playAuth 是播放凭证 通过后端自己根据api去获取返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放
var playAuth = this.playAuth.replace(/=/g, ""); var playAuth = this.playAuth.replace(/=/g, "");
// var playAuth = playAuthsss // var playAuth = playAuthsss
this.videoData = { this.videoData = {
// ...res.video,//视频其他信息 // ...res.video,//视频其他信息
videoId: this.videoId,//阿里云视频id type: 1,
playAuth: this.playAuth,//阿里云播放凭证 videoId: this.videoId, //阿里云视频id
}; playAuth: playAuth, //阿里云播放凭证
console.log('到这') };
this.playAuth = playAuth; console.log('得到播放凭证')
this.$forceUpdate(); this.playAuth = playAuth;
this.$forceUpdate();
},
// setTimeout(() => {
// console.log('销毁播放器')
// // this.player.dispose()
// this.player = null
// player = null
// console.log('销毁后',this.player, player)
// },2000)
},
tabChange(e) { tabChange(e) {
console.log(e, 'e'); console.log(e, 'e');
// this.destroyPlayer = true
let _index = e.index let _index = e.index
this.clickCourseInfo(this.treeList[_index]) this.clickCourseInfo(this.treeList[_index])
this.curTagIndex = _index this.curTagIndex = _index
@@ -207,21 +236,25 @@
this.Leve1 = [] this.Leve1 = []
this.Leve2 = [] this.Leve2 = []
this.Leve3 = [] this.Leve3 = []
this.leve3store = []
} }
// this.destroyPlayer = false
}, },
leve1Click(val, index) { leve1Click(val, index) {
console.log(this.Leve1[index], 'val'); console.log(this.Leve1[index], 'val');
this.leve1Index = index this.leve1Index = index
this.leve2Index = null this.leve2Index = null
this.leve3Index = null this.leve3Index = null
this.clickCourseInfo(val)
if (this.Leve1[index].isLast == 0 && this.Leve1[index].children.length > 0) { if (this.Leve1[index].isLast == 0 && this.Leve1[index].children.length > 0) {
this.Leve2 = this.Leve1[index].children this.Leve2 = this.Leve1[index].children
console.log(this.Leve2, 'Leve2'); console.log(this.Leve2, 'Leve2--------------------');
} else { } else {
this.Leve2 = [] this.Leve2 = []
this.Leve3 = [] this.Leve3 = []
this.leve3store = []
} }
this.clickCourseInfo(val)
}, },
leve2Click(val, index) { leve2Click(val, index) {
this.leve2Index = index this.leve2Index = index
@@ -230,26 +263,40 @@
} }
this.leve3Index = null this.leve3Index = null
// console.log(val,'三级点击'); // console.log(val,'三级点击');
this.clickCourseInfo(val)
if (this.Leve2[index].isLast == 0 && this.Leve2[index].children.length > 0) { if (this.Leve2[index].isLast == 0 && this.Leve2[index].children.length > 0) {
this.Leve3 = this.Leve2[index].children this.Leve3 = this.Leve2[index].children
} else { } else {
this.Leve3 = [] this.Leve3 = []
this.leve3store = []
} }
this.clickCourseInfo(val)
}, },
leve3Click(val, index) { leve3Click(val, index,list) {
this.leve3Index = index this.leve3Index = index
// console.log(val,'四级点击'); console.log(val,'四级点击');
if (this.leve2Index == null) { if (this.leve2Index == null) {
this.leve2Index = 0 this.leve2Index = 0
} }
if (this.leve1Index == null) { if (this.leve1Index == null) {
this.leve1Index = 0 this.leve1Index = 0
} }
this.clickCourseInfo(val) // console.log('this.Leve3this.Leve3this.Leve3this.Leve3this.Leve3this.Leve3this.Leve3')
// if(this.Leve3[index].isLast == 0){ if(this.Leve3.length > 0){
// this.Leve3 = this.Leve2[index].children this.leve3store = [...this.Leve3]
// } }else{
this.leve3store = [...list]
}
console.log(this.Leve3,'this.leve3++++++++++++++++++')
// this.Leve3
// uni.setStorage({
// key: 'leve3',
// data: this.Leve3,
// success: function () {
// // console.log('success');
// }
// });
this.clickCourseInfo(val)
}, },
formatRichText(html) { //控制图片大小 formatRichText(html) { //控制图片大小
@@ -303,24 +350,29 @@
}) })
// console.log(this.Leve2,'Leve2'); // console.log(this.Leve2,'Leve2');
if (this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0) { if (this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0) {
this.Leve3 = this.Leve2[0].children
this.Leve3.forEach((item, index) => { this.Leve3 = this.Leve2[0].children
if (item.id == this.tagId) { this.Leve3.forEach((item, index) => {
this.leve3Index = index if (item.id == this.tagId) {
} this.leve3Index = index
}) }
})
} else { } else {
this.Leve3 = [] this.Leve3 = []
// this.leve3store = []
} }
} else { } else {
this.Leve2 = [] this.Leve2 = []
this.Leve3 = [] this.Leve3 = []
this.leve3store = []
} }
} else { } else {
this.Leve1 = [] this.Leve1 = []
this.Leve2 = [] this.Leve2 = []
this.Leve3 = [] this.Leve3 = []
this.leve3store = []
} }
// this.getCourseInfo(this.treeList[0].id) // this.getCourseInfo(this.treeList[0].id)
@@ -354,18 +406,22 @@
if (this.courseInfo.mediaType == 1 && this.courseInfo.media != '') { if (this.courseInfo.mediaType == 1 && this.courseInfo.media != '') {
this.videoId = this.courseInfo.media this.videoId = this.courseInfo.media
this.playAuth = await this.getVideoPath(this.courseInfo.media) this.playAuth = await this.getVideoPath(this.courseInfo.media)
// this.getLive(this.playAuth) this.getLive(this.playAuth)
console.log()
// this.videoData = {
// videoId: this.videoId,//阿里云视频id
// playAuth: this.videoUrl,//阿里云播放凭证
// }
} else { } else {
// this.videoUrl = '' // this.videoUrl = ''
this.poster = '' // this.poster = ''
} }
// console.log(id, 'id') // console.log(this.leve3store, '----------Leve3----')
// uni.setStorage
let list = uni.getStorage({
key:'leve3'
})
if(list.length > 0){
this.Leve3 = list
}
console.log('----------新的Leve3----', this.Leve3)
} else { } else {
this.courseInfo = {} this.courseInfo = {}
this.videoUrl = '' this.videoUrl = ''
@@ -394,10 +450,6 @@
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
// this.$http
// .post('sociology/course/checkVideo',{
// id: str
// })
.then(res => { .then(res => {
if (res.code == 0) { if (res.code == 0) {
// console.log(res, 'res'); // console.log(res, 'res');
@@ -423,90 +475,481 @@
}; };
</script> </script>
<script module="renderScript" lang="renderjs"> <script module="renderScript" lang="renderjs">
export default { import $ from 'jquery'
mounted() { // import StaticADComponent from './staticadcomponent/index.js';
// 在适合的生命周期通过script和link标签引入播放器sdk、css /**
this.loadWebPlayerSDK() * 静态广告组件
}, */
data() {
return { export default {
player: null, /**
* 静态广告组件
} */
},
methods: { components: {
getLive() { // MyComponent
//配置播放器
var player = new Aliplayer({
id: "url-player-test",
"vid": this.videoData.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频查询。示例1e067a2831b641db90d570b6480f****。
"playauth": this.videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。
"encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
"playConfig": {
"EncryptType": 'AliyunVoDEncryption'
},
width: '100%', //容器的大小
height: '600rpx', //容器的大小
}, function(player) {
console.log('走吗')
});
this.player = player;
player.one('canplay', function() {
// console.log('canplay', this.player.tag);
player.tag.play();
});
}, },
//监听获取播放凭证的方法 mounted() {
checkValue() { // 在适合的生命周期通过script和link标签引入播放器sdk、css
console.log(this.videoId, this.videoData.playAuth, "1111888888") console.log(this.options, '这是monted')
if (!this.videoData.playAuth) { this.loadWebPlayerSDK()
// setTimeout(() => { this.loadComponent()
// this.checkValue(); },
// }, 2000); beforeDestroy() {
if (this.player) {
this.player.dispose()
this.player = null
}
},
data() {
return {
player: null,
curTime: null,
curStatus: null,
// currentTime:null,
}
},
watch: {
curTime(val) {
if (this.curTime !== null && this.curStatus !== null) {
this.$refs.videoContent1.click()
}
}
},
methods: {
handleClick(event, ownerInstance) {
console.log('event at line 165:', event)
// this.player.on('ready',function(){
// var status= this.player.fullscreenService.getIsFullScreen()
// console.log('status at line 403:', status)
// console.log('触发点击事件',status))
// })
ownerInstance.callMethod('getData')
},
emitData(event, ownerInstance) {
var that = this;
ownerInstance.callMethod('recordTime', {
time: that.curTime,
status: that.curStatus
})
},
changeVideoScreen(event, ownerInstance) {
var that = this;
// this.$emit('changeScreenLoading',true)
var status = this.player.fullscreenService.getIsFullScreen();
ownerInstance.callMethod('screenChange', {
status: status,
primary: status ? 'portrait' : 'landscape'
})
if (status) {
setTimeout(() => {
plus.screen.lockOrientation("portrait-primary"); //锁死屏幕方向为竖屏
this.player.fullscreenService.cancelFullScreen();
// this.$emit('changeScreenLoading',false);
}, 100);
// this.player.setPlayerSize('100%','200px');
} else { } else {
// this.player.setPlayerSize({
// w:"400px",
// height:'60%'
// });
// plus.screen.unlockOrientation();
this.player.fullscreenService.requestFullScreen();
setTimeout(() => {
// this.$emit('changeScreenLoading',false);
plus.screen.lockOrientation("landscape-primary");
}, 100);
}
},
endEmitData(event, ownerInstance) {
var that = this;
ownerInstance.callMethod('handleEnd', )
},
getLive() {
if (this.videoData.type == 1) {
var fullScreenButtonComponent = Aliplayer.Component({
/**
* 初始函数在new对象时调用
*
* @param {string} adAddress - 广告视频地址
* @param {string} toAddress - 广告链接地址
*/
init: function(status, toAddress) {
this.fullScreenStatus = status
// this.adAddress = adAddress;
// this.toAddress = toAddress;
this.$html = $('.fullScreenButton-container');
// this.$html.hide();
},
/**
* 创建广告Dom元素
*/
createEl: function(el) {
this.$html.find('.ad').attr('src', this.adAddress);
var $adWrapper = this.$html.find('.ad-wrapper');
$adWrapper.attr('href', this.toAddress);
$adWrapper.click(function() {
// Aliplayer.util.stopPropagation();
});
// this.$html.find('.close').click(function () {
// this.$html.hide();
// });
// $(el).find('.prism-controlbar').append(this.$html);
$(el).find('.prism-time-display').after(this.$html);
},
ready: function(player, e) {
// this.$html.hide()
},
/**
* 隐藏广告
*/
play: function(player, e) {
// this.$html.show();
},
/**
* 显示广告
*/
pause: function(player, e) {
// this.$html.show();
},
/**
* 隐藏广告
*/
playing: function(player, e) {
this.$html.show();
// this.$html.hide();
},
waiting: function(player, e) {
// this.$html.hide()
},
timeupdate: function(player, e) {},
error: function(player, e) {},
/**
* 显示广告
*/
ended: function(player, e) {
// this.$html.show();
}
});
console.log('this.currentVideoList at line 456111111111111111111111:', this.videoList)
var player = new Aliplayer({
id: "url-player-test",
"vid": this.videoData.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频查询。示例1e067a2831b641db90d570b6480f****。
"playauth": this.videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。
"encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
"playConfig": {
"EncryptType": 'AliyunVoDEncryption'
},
width: '100%', //容器的大小
// videoWidth: '100vw', //容器的大小
// videoHeight: '100vh', //容器的大小
height: '200px', //容器的大小
playsinline: true,
controlBarVisibility: "click",
cover: "http://ehh-public-01.oss-cn-beijing.aliyuncs.com/wumenyishu-image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240606110049.jpg",
autoplay: false,
components: [
// {
// name: 'BulletScreenComponent',
// type: AliPlayerComponent.BulletScreenComponent,
// /** Descriptions of the scrolling text component parameters: text, style, bulletPosition
// * text: The scrolling text
// * style: The style of the scrolling text
// * bulletPosition: The position of the scrolling text. Valid values: 'top', 'bottom', and 'random'. The default is 'random'.
// */
// args: ['本课程版权归天津众妙之门科技有限公司所有,翻版必究!', {fontSize: '16px', color: 'red',}, 'random']
// },
{
name: 'adComponent',
type: fullScreenButtonComponent,
args: [
'http://101.201.146.165:8088/Pf-EH/statics/uploadFile/2024-05-10/b0f420c7-9178-41ad-9dd6-f59a64a6e190.png']
},
// {
// name: 'RotateMirrorComponent',
// type: AliPlayerComponent.RotateMirrorComponent
// },
],
skinLayout: [{
name: "bigPlayButton",
align: "blabs",
x: 30,
y: 80
},
{
name: "H5Loading",
align: "cc"
},
{
name: "errorDisplay",
align: "tlabs",
x: 0,
y: 0
},
{
name: "infoDisplay"
},
{
name: "tooltip",
align: "blabs",
x: 0,
y: 56
},
{
name: "thumbnail"
},
{
name: "controlBar",
align: "blabs",
x: 0,
y: 0,
children: [{
name: "progress",
align: "blabs",
x: 0,
y: 44
},
{
name: "playButton",
align: "tl",
x: 15,
y: 12
},
{
name: "timeDisplay",
align: "tl",
x: 10,
y: 7
},
{name: "fullScreenButton", align: "tr", x: 10, y: 12},
// {name:"subtitle", align:"tr",x:15, y:12},
{
name: "setting",
align: "tr",
x: 15,
y: 12
},
{
name: "prism-speed-selector",
align: "tr",
x: 15,
y: 12
},
{
name: "volume",
align: "tr",
x: 5,
y: 10
}
]
}
]
}, function(player) {
});
this.player = player;
this.$refs.videoContent.click()
var timer = setInterval(() => {
var that = this;
that.curTime = parseInt(this.player.getCurrentTime());
that.curStatus = this.player.getStatus()
}, 1000);
// player.on('ready',function(){
// player.fullscreenService.requestFullScreen()
// })
this.player.on('ended', function() {
console.log('that.curTime at line 242:', this.curTime)
console.log('that.curStatus at line 210:', this.curStatus)
this.$refs.videoContent2.click()
})
}
// player.setRotate(90)
//全屏播放
// player.one('canplay', function() {
// // console.log('canplay', this.player.tag);
// player.tag.play();
// });
},
receiveScreenType(newValue) {
console.log('newValue at line 427屏幕方向111111111111:', newValue)
},
receiveFirstTime(newValue, oldValue, ownerVm, vm) {
// //数据变化
console.log('newValue111', newValue)
console.log('vm4444', vm)
console.log('this.firstTime at line 215:', newValue)
if (this.player) {
this.player.seek(newValue);
}
},
receiveVideoList(newValue, oldValue, ownerVm, vm) {
// //数据变化
console.log('currentVideoListcurrentVideoListcurrentVideoList', newValue)
},
receiveMsg(newValue, oldValue, ownerVm, vm) {
//数据变化
console.log('newValue', newValue)
if(newValue.playAuth){
this.checkValue();
}
// console.log('oldValue', oldValue)
// console.log('ownerVm', ownerVm)
// console.log('vm', vm)
},
receiveWinWidth(newValue, oldValue, ownerVm, vm) {
//数据变化
console.log('newValue', newValue)
// console.log('oldValue', oldValue)
// console.log('ownerVm', ownerVm)
// console.log('vm', vm)
},
receiveWinHeight(newValue, oldValue, ownerVm, vm) {
//数据变化
console.log('newValue', newValue)
// console.log('oldValue', oldValue)
// console.log('ownerVm', ownerVm)
// console.log('vm', vm)
},
checkValue() {
// console.log(this.courseInfo,'this.courseInfo');
// if(this.courseInfo){
// if(this.courseInfo.mediaType != 1 || this.courseInfo.media = ''){
// console.log('不符合规则跳出');
// return
// }
// }
console.log(this.videoData, "1111888888")
if (!this.videoData.playAuth) {
setTimeout(() => {
this.checkValue();
}, 1000);
} else {
console.log('this.videoList at line 这是这只只是594:', this.currentVideoList)
this.getLive(); this.getLive();
} }
}, },
loadWebPlayerSDK() {
return new Promise((resolve, reject) => {
loadWebPlayerSDK() { const s_tag = document.createElement('script'); // 引入播放器js
return new Promise((resolve, reject) => { s_tag.type = 'text/javascript';
const s_tag = document.createElement('script'); // 引入播放器js s_tag.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/aliplayer-min.js';
s_tag.type = 'text/javascript'; s_tag.charset = 'utf-8';
s_tag.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/aliplayer-min.js'; s_tag.onload = () => {
s_tag.charset = 'utf-8'; const s_tag1 = document.createElement('script'); // 引入播放器js
s_tag.onload = () => { s_tag1.type = 'text/javascript';
this.checkValue(); s_tag1.src =
'https://player.alicdn.com/aliplayer/presentation/js/aliplayercomponents.min.js';
s_tag1.charset = 'utf-8';
s_tag1.onload = () => {
// this.checkValue();
resolve(); resolve();
} }
document.body.appendChild(s_tag); document.body.appendChild(s_tag1);
const l_tag = document.createElement('link'); // 引入播放器css
l_tag.rel = 'stylesheet'; }
l_tag.href = document.body.appendChild(s_tag);
'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/skins/default/aliplayer-min.css';
const l_tag = document.createElement('link'); // 引入播放器css
document.body.appendChild(l_tag); l_tag.rel = 'stylesheet';
}); l_tag.href =
}, 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/skins/default/aliplayer-min.css';
loadComponent() {
return new Promise((resolve, reject) => {
const s_tag = document.createElement('script');
s_tag.type = 'text/javascript'; document.body.appendChild(l_tag);
// 需要先下载组件 js 文件,放到项目 /static/ 目录下 });
// 下载地址https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/customComponents/dist/aliplayer-components/aliplayercomponents-1.0.9.min.js },
s_tag.src = './utils/aliplayercomponents.min.js'; loadComponent() {
s_tag.charset = 'utf-8'; // return new Promise((resolve, reject) => {
s_tag.onload = () => { // const s_tag = document.createElement('script');
resolve(); // s_tag.type = 'text/javascript';
} // // 需要先下载组件 js 文件,放到项目 /static/ 目录下
document.body.appendChild(s_tag); // // 下载地址https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/customComponents/dist/aliplayer-components/aliplayercomponents-1.0.9.min.js
}); // s_tag.src = '@/static/aliplayercomponents.js';
// s_tag.charset = 'utf-8';
// s_tag.onload = () => {
// resolve();
// }
// document.body.appendChild(s_tag);
// });
}
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';

View File

@@ -2,38 +2,43 @@
<view> <view>
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<z-nav-bar :title="pageTitle ? pageTitle : '课程中心'"></z-nav-bar> <z-nav-bar title="我的课程"></z-nav-bar>
<view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
</view>
<view class="containerBg1"> <view class="containerBg1">
<!-- <view class="containerBg"> --> <!-- <view class="containerBg"> -->
<view class="coursePart flexbox" v-if="tabList.length > 1"> <view class="newBox">
<view :class="['item','flexbox',curId == item.id? 'active': '' ]" v-for="(item, index) in tabList" <view class="item flexbox" v-for="(item, index) in MyCourseList.list" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id)">
:key="index" @click="clicklib(item,index)"> <!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<!-- <u-icon v-if="item.isBuy == 0 && curId == item.id" name="lock" color="#258feb" size="28"></u-icon> --> <view class="imgcontainer">
<!-- <u-icon v-if="item.isBuy == 0 && curId != item.id" name="lock" color="#fff" size="28"></u-icon> --> <image :src="item.image" mode="aspectFit"></image>
<view class="">{{item.title}}</view> </view>
</view> <view class="buyItems">
</view> <view class="txt555">
<view :class="['courseList',fold ? 'fold' : '']" v-if="courseList.length > 0"> {{item.title}}
<!-- 目录是否已经购买 --> </view>
<!-- 0:普通 1超级 2医学 3国学 --> <view class="jianjie" v-html="item.content">
<view class="endBox" v-if="tabList[curIndex].isBuy == 1 && userMsg.vip == '0'">
<view class="" > </view>
<view class="flexbox" v-if="tabList[curIndex].startTime == null"> <view class="tag-view">
<text >当前目录还未开始学习</text><uni-tag type="warning" text="去学习" @click="goToLearn()"></uni-tag> <uni-tag v-if="item.level != 0" style="margin-right: 10rpx;" :text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;" text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;" text="选修" size="small" type="success" />
</view>
<view class="btn_box">
<text>了解课程</text>
</view>
</view>
</view> </view>
<view class="flexbox" v-else>
<text >课程观看有效期截止到{{tabList[curIndex].endTime}} </text><uni-tag type="primary" @click="goToLearn()" text="继续学习"></uni-tag>
</view>
</view> </view>
<u-divider v-show="MyCourseList.status == 2" text="已加载全部"></u-divider>
<u-divider v-show="MyCourseList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="MyCourseList.status == 1" text="加载中..."></u-divider>
</view> </view>
<view class="item" v-for="(item, index) in courseList" :key="index" @click="chooseChapter(item, index)">
<text>{{item.title}}</text>
<uni-tag v-if="item.isAudition == 1" style="margin-left: 10rpx;" :inverted="true" text="试听"
size="mini" type="primary" />
</view>
</view>
<u-divider v-else text="暂无数据"></u-divider>
<view> <view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle' <u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
@@ -61,6 +66,7 @@
export default { export default {
data() { data() {
return { return {
curTagId:0,
playData: {}, playData: {},
// fixed: false, // fixed: false,
bgiStyle: { bgiStyle: {
@@ -81,13 +87,29 @@
}, },
scrollable: false, scrollable: false,
pageTitle: null, pageTitle: null,
courseList: [], fixed:false,
tabList: [{id:1, name:'我的课程'},{id:2, name:'在学习'},{id:3, name:'已过期'}], // 目录列表 tabList: [{id:1, name:'我的课程'},{id:2, name:'在学习'},{id:3, name:'已过期'}], // 目录列表
curId: null, curId: null,
curIndex: 0, curIndex: 0,
MyCourseList:{
list:[],
status:88,
page:1,
flag:false
},
LearningCourseList:{
list:[],
status:88,
page:1,
flag:false
},
ExpiredCourseList:{
list:[],
status:88,
page:1,
flag:false
}
}; };
}, },
@@ -99,10 +121,10 @@
// this.pageTitle = e.title // this.pageTitle = e.title
console.log(e, '传入分类id') console.log(e, '传入分类id')
this.getUserInfo() this.getUserInfo()
// this.courseId = e.id this.fatherClick()
// this.getCateList(this.courseId) this.getMyCourseList()
// this.getData(e.id) this.getLearningCourseList()
// this.getSayList() this.getExpiredCourseList()
}, },
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
@@ -123,10 +145,10 @@
}, },
onReachBottom() { onReachBottom() {
console.log('触底'); console.log('触底');
if (this.status != 2) { // if (this.status != 2) {
this.pPage++ // this.pPage++
this.getSayList() // this.getSayList()
} // }
}, },
components: { components: {
// musicPlay // musicPlay
@@ -136,6 +158,51 @@
}, },
//方法 //方法
methods: { methods: {
fatherClick(){},
getMyCourseList(){
this.MyCourseList.status = 1
if (!this.MyCourseList.flag) {
console.log('正在执行,未完成')
return
}
this.MyCourseList.flag = false
$http.request({
url: "medical/home/getMedicalCourseList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"id": id,
"limit": 12,
"page": this.MyCourseList.page
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.courses.records.length > 0) {
var list = res.courses.records
this.courseList = this.MyCourseList.list.concat(list)
if (res.courses.pages > this.MyCourseList.page) {
this.MyCourseList.status = 0
} else {
this.MyCourseList.status = 2
}
}
else {
this.MyCourseList.status = 3 // 暂无数据
}
console.log('status', this.MyCourseList.status)
}
this.MyCourseList.flag = true
}).catch(e => {
console.log(e, '数据报错')
});
},
getLearningCourseList(){},
getExpiredCourseList(){},
getUserInfo() { getUserInfo() {
// 用户详情 // 用户详情
// if (this.userInfo.id != undefined) { // if (this.userInfo.id != undefined) {
@@ -160,7 +227,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';
.tabsBox{background-color: #e4eefa;}
.flexbox { .flexbox {
display: flex; display: flex;
} }

View File

@@ -14,7 +14,7 @@
</view> </view>
<view class="fourBox"> <view class="fourBox">
<view class="fourIcon flexbox" style="justify-content: space-around;"> <view class="fourIcon flexbox" style="justify-content: space-around;">
<div class="item flexbox" @click="onPageJump()"> <div class="item flexbox" @click="onPageJump('/pages/course/myCourse')">
<image src="../../static/my_02.png" mode="aspectFit"></image> <image src="../../static/my_02.png" mode="aspectFit"></image>
<text>我的课程</text> <text>我的课程</text>
</div> </div>

View File

@@ -357,6 +357,7 @@ export default {
}, },
//导航字体是否是白色颜色 //导航字体是否是白色颜色
isWhite() { isWhite() {
// console.log(whiteList,'this.navFontColor')
return whiteList.includes(this.navFontColor); return whiteList.includes(this.navFontColor);
}, },
//右上角是否有两个按钮 //右上角是否有两个按钮
@@ -404,9 +405,9 @@ export default {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
let pageLen = currentPages.length; let pageLen = currentPages.length;
//判断是否是第一个页面如果是有设置back为true的页面将不显示返回箭头而显示返回首页按钮 //判断是否是第一个页面如果是有设置back为true的页面将不显示返回箭头而显示返回首页按钮
if (pageLen == 1 && !mainPagePath.includes(currentPages[0].route)) { // if (pageLen == 1 && !mainPagePath.includes(currentPages[0].route)) {
this.firstPage = true; // this.firstPage = true;
} // }
}, },
//方法 //方法
methods: { methods: {