From 2523845927773453d8c7b684df5b901c3ad158c3 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Thu, 20 Jun 2024 17:04:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AF=B4=E6=98=8E=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 2 +- pages.json | 6 +- .../commonComponents/video/index.vue | 52 +- pages/course/courseDetail.vue | 4 +- pages/course/illustrate.vue | 709 ++++++++++++++---- pages/course/myCourse.vue | 147 +++- pages/peanut/home.vue | 2 +- .../components/z-nav-bar/z-nav-bar.vue | 7 +- 8 files changed, 718 insertions(+), 211 deletions(-) diff --git a/main.js b/main.js index 7b3a69b..7f40514 100644 --- a/main.js +++ b/main.js @@ -22,7 +22,7 @@ Vue.prototype.$getHours = nowHour Vue.prototype.$baseUrl = "https://api.nuttyreading.com/" // 安卓安卓包下载地址 // 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" // 应用宝 // 判断手机型号 diff --git a/pages.json b/pages.json index 7074500..3394d43 100644 --- a/pages.json +++ b/pages.json @@ -1,7 +1,7 @@ { - // "easycom": { - // "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" - // }, + "easycom": { + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" + }, "pages": [ { "path": "pages/peanut/home", diff --git a/pages/component/commonComponents/video/index.vue b/pages/component/commonComponents/video/index.vue index f551d17..fe98850 100644 --- a/pages/component/commonComponents/video/index.vue +++ b/pages/component/commonComponents/video/index.vue @@ -16,16 +16,7 @@ ref="videoContent" @tap="renderScript.handleClick" id="url-player-test" - :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" + :videoData="videoData" >
直接调用renderjs中的emitData的方法,传递当前播放时长 @@ -152,7 +143,7 @@ export default { this.options = JSON.parse(options.data); - this.videoId = this.options.video; + this.videoId = this.options.id; this.timer = setInterval(() => { var that = this; @@ -212,7 +203,7 @@ export default { } this.options = data.currentVideo; console.log("this.options at line 64:", this.options); - this.videoId = this.options.video; + this.videoId = this.options.id; this.timer = setInterval(async () => { var that = this; if (this.currentTime) { @@ -297,13 +288,14 @@ export default { }, // 获取数据 getLive() { + console.log(this.options,'----------------11111111111111--------') var data = { ...this.options, }; - + console.log(data,'------------------------') $http .request({ - url: `sociology/course/checkVideo`, + url: "medical/course/checkVideoByMD", method: "Post", // POST、GET、PUT、DELETE,具体说明查看官方文档 data, header: { @@ -313,22 +305,23 @@ export default { }) .then((res) => { console.log("res at line 252111111111111111111111111111:", res); + if (this.currentVideo.type == 1) { - var playAuth = res.video.playAuth.replace(/=/g, ""); + var playAuth = res.playAuth.replace(/=/g, ""); this.videoData = { - ...res.video, - videoId: res.video.video, + ...res, + video: res.id, playAuth: playAuth, }; this.playAuth = playAuth; } else { - this.videoData = res.video; - this.videoUrl = - // "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/" + - res.video.videoUrl; - this.$nextTick(async () => { - await this.getData(); - }); + // this.videoData = res.video; + // this.videoUrl = + // // "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/" + + // res.video.videoUrl; + // this.$nextTick(async () => { + // await this.getData(); + // }); } this.$forceUpdate(); @@ -505,6 +498,9 @@ this.player.fullscreenService.requestFullScreen(); ownerInstance.callMethod('handleEnd', ) }, getLive() { + + + console.log(this.videoData,'走没走。。。。。。。。。。') if(this.videoData.type==1){ var fullScreenButtonComponent = Aliplayer.Component({ /** @@ -732,15 +728,15 @@ this.player.on('ended', function() { // console.log('vm', vm) }, checkValue() { - console.log(this.videoId, this.authId, "1111888888") - if (!this.videoData.playAuth||!this.currentVideoList) { + console.log(this.videoId, 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();console.log('this.videoList at line 这是这只只是594:',this.videoData) } }, loadWebPlayerSDK() { diff --git a/pages/course/courseDetail.vue b/pages/course/courseDetail.vue index d870584..184aeca 100644 --- a/pages/course/courseDetail.vue +++ b/pages/course/courseDetail.vue @@ -591,12 +591,12 @@ }, // 查询课程的评论 getSayList() { + this.status = 1 if (this.loadFlag) { console.log('有未完成的进程'); return } - this.loadFlag = true - this.status = 1 + this.loadFlag = true $http.request({ url: "common/courseGuestbook/getCourseGuestbookList", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 diff --git a/pages/course/illustrate.vue b/pages/course/illustrate.vue index 841ab26..7d85150 100644 --- a/pages/course/illustrate.vue +++ b/pages/course/illustrate.vue @@ -18,34 +18,48 @@ {{item.title}} + + + + {{item.title}} {{item.title}} - + + + + - - - - + :videoData="videoData" + :change:videoData="renderScript.receiveMsg">
+ - - - - - + + + + @@ -65,11 +79,12 @@ data() { return { playData: {}, + // destroyPlayer:false, Leve1: [], Leve2: [], Leve3: [], accordionVal: '', - options: {},//上个页面获取的视频参数(视频id) + options: {}, //上个页面获取的视频参数(视频id) playAuth: "", //播放凭证 videoId: "", //阿里云视频id videoData: {}, //阿里云视频其他参数 @@ -116,6 +131,7 @@ audioAction: { method: 'pause' }, + leve3store:[], curId: null, courseTitle: '', showTemp: true, @@ -152,36 +168,49 @@ // #endif this.showTemp = true this.videoContext = null + }, onPullDownRefresh() { uni.stopPullDownRefresh() }, components: { // musicPlay + // commonVideo }, created() { - // this.getLive();//获取播放凭证 - - }, + // this.getLive();//获取播放凭证 + + }, //方法 methods: { // 获取数据 - getLive(playAuthsss) { - //playAuth 是播放凭证 通过后端自己根据api去获取,返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放 - var playAuth = this.playAuth.replace(/=/g, ""); - // var playAuth = playAuthsss - this.videoData = { - // ...res.video,//视频其他信息 - videoId: this.videoId,//阿里云视频id - playAuth: this.playAuth,//阿里云播放凭证 - }; - console.log('到这') - this.playAuth = playAuth; - this.$forceUpdate(); - - }, + getLive(playAuthsss) { + //playAuth 是播放凭证 通过后端自己根据api去获取,返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放 + var playAuth = this.playAuth.replace(/=/g, ""); + // var playAuth = playAuthsss + this.videoData = { + // ...res.video,//视频其他信息 + type: 1, + videoId: this.videoId, //阿里云视频id + playAuth: playAuth, //阿里云播放凭证 + }; + console.log('得到播放凭证') + this.playAuth = playAuth; + this.$forceUpdate(); + + + // setTimeout(() => { + // console.log('销毁播放器') + // // this.player.dispose() + // this.player = null + // player = null + // console.log('销毁后',this.player, player) + // },2000) + + }, tabChange(e) { console.log(e, 'e'); + // this.destroyPlayer = true let _index = e.index this.clickCourseInfo(this.treeList[_index]) this.curTagIndex = _index @@ -207,21 +236,25 @@ this.Leve1 = [] this.Leve2 = [] this.Leve3 = [] + this.leve3store = [] } + // this.destroyPlayer = false }, leve1Click(val, index) { console.log(this.Leve1[index], 'val'); this.leve1Index = index this.leve2Index = null this.leve3Index = null - this.clickCourseInfo(val) + if (this.Leve1[index].isLast == 0 && this.Leve1[index].children.length > 0) { this.Leve2 = this.Leve1[index].children - console.log(this.Leve2, 'Leve2'); + console.log(this.Leve2, 'Leve2--------------------'); } else { this.Leve2 = [] this.Leve3 = [] + this.leve3store = [] } + this.clickCourseInfo(val) }, leve2Click(val, index) { this.leve2Index = index @@ -230,26 +263,40 @@ } this.leve3Index = null // console.log(val,'三级点击'); - this.clickCourseInfo(val) + if (this.Leve2[index].isLast == 0 && this.Leve2[index].children.length > 0) { this.Leve3 = this.Leve2[index].children } else { this.Leve3 = [] + this.leve3store = [] } + this.clickCourseInfo(val) }, - leve3Click(val, index) { + leve3Click(val, index,list) { this.leve3Index = index - // console.log(val,'四级点击'); + console.log(val,'四级点击'); if (this.leve2Index == null) { this.leve2Index = 0 } if (this.leve1Index == null) { this.leve1Index = 0 } - this.clickCourseInfo(val) - // if(this.Leve3[index].isLast == 0){ - // this.Leve3 = this.Leve2[index].children - // } + // console.log('this.Leve3this.Leve3this.Leve3this.Leve3this.Leve3this.Leve3this.Leve3') + if(this.Leve3.length > 0){ + 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) { //控制图片大小 @@ -303,24 +350,29 @@ }) // console.log(this.Leve2,'Leve2'); if (this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0) { - this.Leve3 = this.Leve2[0].children - this.Leve3.forEach((item, index) => { - if (item.id == this.tagId) { - this.leve3Index = index - } - }) + + this.Leve3 = this.Leve2[0].children + this.Leve3.forEach((item, index) => { + if (item.id == this.tagId) { + this.leve3Index = index + } + }) + } else { this.Leve3 = [] + // this.leve3store = [] } } else { this.Leve2 = [] this.Leve3 = [] + this.leve3store = [] } } else { this.Leve1 = [] this.Leve2 = [] this.Leve3 = [] + this.leve3store = [] } // this.getCourseInfo(this.treeList[0].id) @@ -354,18 +406,22 @@ if (this.courseInfo.mediaType == 1 && this.courseInfo.media != '') { this.videoId = this.courseInfo.media this.playAuth = await this.getVideoPath(this.courseInfo.media) - // this.getLive(this.playAuth) - console.log() - // this.videoData = { - // videoId: this.videoId,//阿里云视频id - // playAuth: this.videoUrl,//阿里云播放凭证 - // } + this.getLive(this.playAuth) } else { // 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 { this.courseInfo = {} this.videoUrl = '' @@ -394,10 +450,6 @@ 'Content-Type': 'application/json' }, }) - // this.$http - // .post('sociology/course/checkVideo',{ - // id: str - // }) .then(res => { if (res.code == 0) { // console.log(res, 'res'); @@ -423,90 +475,481 @@ }; +