diff --git a/components/tagTree.vue b/components/tagTree.vue new file mode 100644 index 0000000..6b4d176 --- /dev/null +++ b/components/tagTree.vue @@ -0,0 +1,179 @@ + + + + + \ No newline at end of file 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 d615283..0f9f100 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", @@ -371,13 +371,13 @@ "navigationBarTitleText": "总课程说明" } }, - { - "path": "pages/course/illustrate", - "style": { - "navigationBarTitleText": "课程说明", - "enablePullDownRefresh": true - } - }, + // { + // "path": "pages/course/illustrate", + // "style": { + // "navigationBarTitleText": "课程说明", + // "enablePullDownRefresh": true + // } + // }, { "path": "pages/course/outline", "style": { 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/courseSet.vue b/pages/course/courseSet.vue index fd7cb72..fb55f09 100644 --- a/pages/course/courseSet.vue +++ b/pages/course/courseSet.vue @@ -21,7 +21,10 @@ {{item.title}} - + + + + @@ -29,18 +32,18 @@ author="吴门医述" :action="audioAction" controls> - - - - - - + +
+
+
+
+
@@ -65,10 +68,15 @@ export default { data() { return { + isFullScreen: false, playData: {}, Leve1:[], Leve2:[], Leve3:[], + options: {}, //上个页面获取的视频参数(视频id) + playAuth: "", //播放凭证 + videoId: "", //阿里云视频id + videoData: {}, //阿里云视频其他参数 accordionVal: '', // extraIcon:{ // color: '#4cd964', @@ -104,10 +112,10 @@ poster:'../../static/videoF.jpg', //封面图 audioPoster:'../../static/logo.png', current: { - poster: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png', - name: '致爱丽丝', - author: '暂无', - src: 'https://web-ext-storage.dcloud.net.cn/uni-app/ForElise.mp3', + // poster: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png', + // name: '致爱丽丝', + // author: '暂无', + // src: 'https://web-ext-storage.dcloud.net.cn/uni-app/ForElise.mp3', }, audioAction: { method: 'pause' @@ -156,6 +164,20 @@ }, //方法 methods: { + 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(); + }, tabChange(e){ console.log(e,'e'); let _index = e.index @@ -166,18 +188,21 @@ this.leve3Index = null if(this.treeList[_index].isLast == 0 && this.treeList[_index].children.length > 0){ this.Leve1 = this.treeList[_index].children - if(this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0){ - this.Leve2 = this.Leve1[0].children - // console.log(this.Leve2,'Leve2'); - if(this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0){ - this.Leve3 = this.Leve2[0].children - }else{ - this.Leve3 = [] - } - }else{ - this.Leve2 = [] - this.Leve3 = [] - } + this.Leve2 = [] + this.Leve3 = [] + // if(this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0){ + // this.Leve2 = this.Leve1[0].children + // this.Leve3 = [] + // // console.log(this.Leve2,'Leve2'); + // if(this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0){ + // this.Leve3 = this.Leve2[0].children + // }else{ + // this.Leve3 = [] + // } + // }else{ + // this.Leve2 = [] + // this.Leve3 = [] + // } }else{ this.Leve1 = [] @@ -193,7 +218,8 @@ 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'); + this.Leve3 = [] }else{ this.Leve2 = [] this.Leve3 = [] @@ -250,23 +276,51 @@ .post('medical/home/getCourseMedicalTree') .then(res => { if (res.code == 0 && res.labels.length > 0) { - this.tabList = [] + this.tabList = [] this.treeList = res.labels - if(this.treeList[0].isLast == 0 && this.treeList[0].children.length > 0){ - this.Leve1 = this.treeList[0].children - if(this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0){ - this.Leve2 = this.Leve1[0].children - // console.log(this.Leve2,'Leve2'); - if(this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0){ - this.Leve3 = this.Leve2[0].children + if(this.tagId && this.pid){ + res.labels.forEach((item, index) => { + this.tabList.push({ + id: item.id, + name: item.title + }) + if (item.id == this.pid) { + this.curTagIndex = index + console.log(this.curTagIndex) + } + }) + this.getCourseInfo(this.tagId) + }else{ + this.curTagIndex = 0 + this.leve1Index = null + this.getCourseInfo(this.treeList[0].id) + } + // this.treeList = res.labels + if(this.treeList[this.curTagIndex].isLast == 0 && this.treeList[this.curTagIndex].children.length > 0){ + this.Leve1 = this.treeList[this.curTagIndex].children + if(this.tagId){ + this.Leve1.forEach((item, index) => { + if (item.id == this.tagId) { + this.leve1Index = index + } + }) + if(this.Leve1[this.leve1Index].isLast == 0 && this.Leve1[this.leve1Index].children.length > 0){ + this.Leve2 = this.Leve1[this.leve1Index].children + // console.log(this.Leve2,'Leve2'); + // if(this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0){ + // this.Leve3 = this.Leve2[0].children + // }else{ + // this.Leve3 = [] + // } }else{ + this.Leve2 = [] this.Leve3 = [] } }else{ + this.leve1Index = null this.Leve2 = [] this.Leve3 = [] - } - + } }else{ this.Leve1 = [] this.Leve2 = [] @@ -275,12 +329,13 @@ res.labels.forEach( item => { this.tabList.push({id:item.id, name: item.title}) }) - this.getCourseInfo(this.treeList[0].id) + // /this.getCourseInfo(this.treeList[0].id) // console.log(this.treeList[0].id,'+++++') // this.showDrawer('showRight') } else { this.treeList = [] } + }).catch(e => { console.log(e, '报错') }); @@ -297,16 +352,15 @@ 'Content-Type': 'application/json' }, }) - .then(res => { + .then(async res => { if (res.code == 0 && res.course.id) { this.courseInfo = res.course this.courseTitle = this.courseInfo.title + '课程说明' this.curId = id - if(this.courseInfo.mediaType == 1 && this.courseInfo.media != ''){ - this.videoUrl = this.courseInfo.media - // this.poster = this.videoUrl + - // "?x-oss-process=video/snapshot,t_0,f_jpg" - // this.getVideoPath(this.courseInfo.media) + 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) }else{ // this.videoUrl = '' this.poster = '' @@ -328,10 +382,11 @@ }); }, // 获得播放地址 - getVideoPath(str){ - console.log(str,'str'); - $http.request({ - url: "sociology/course/checkVideo", + async getVideoPath(str) { + // console.log(str, 'str'); + let path = '' + await $http.request({ + url: "medical/course/checkVideoByMD", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 data: { id: str @@ -340,15 +395,15 @@ 'Content-Type': 'application/json' }, }) - // this.$http - // .post('sociology/course/checkVideo',{ - // id: str - // }) .then(res => { - console.log(res,'res'); + if (res.code == 0) { + // console.log(res, 'res'); + path = res.playAuth + } }).catch(e => { - console.log(e,'获取视频播放地址错误'); + console.log(e, '获取视频播放地址错误'); }) + return path }, clickCourseInfo(item) { this.getCourseInfo(item.id) @@ -364,6 +419,503 @@ }, }; + + + \ No newline at end of file diff --git a/pages/course/index.vue b/pages/course/index.vue index 9f0b7a5..84a670f 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -2,7 +2,7 @@ - 课程说明 + 课程说明 - - - - - - - - {{item.title}} - - - - - - - - - 当前目录还未开始学习 - - - 课程观看有效期截止到:{{tabList[curIndex].endTime}} - - - - - - {{item.title}} - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + {{item.title}} + + + + + + + + + + + 了解课程 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index 0087dfb..c79dd38 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -14,7 +14,7 @@ -
+
我的课程
@@ -198,7 +198,24 @@ - + + + + + + + 疯子读书 + + + + + + + + 众妙之门 + + + @@ -593,7 +610,58 @@ url: '../bookShop/bookShopType?type=' + e }); }, - + appjumpfun(name){ + let bagName = '' + let schemes = '' + if(name == 'zmzm'){ + bagName = 'com.cn.zmzm' + schemes = 'zmzm' + } + if(name == 'nuttyreading'){ + bagName = 'com.cn.nuttyreading' + schemes = 'nuttyreading' + } + // if(name == 'everhealth'){ + if (plus.os.name == "Android") { //安卓 + if (plus.runtime.isApplicationExist({ //查看安卓系统手机有没有下载这款app + pname: bagName, //B款app云打包的包名 + })) { //安装了app + plus.runtime.launchApplication({ //打开app + pname: bagName, //B款app云打包的包名 + extra: { + url: `${schemes}://${bagName}` //B款app配置的schemes+云打包的包名 + }, + function(e) { + console.log("Open system default browser failed: " + e.message); + } + }) + } + else { //未安装app + plus.runtime.openURL(`https://a.app.qq.com/o/simple.jsp?pkgname=${bagName}`, function(res) { + //进入后台小哥哥给我的应用宝下载链接,让你们后台给你 + //这链接会判断你手机是ios还是Android,Android进入应用宝下载app + //跟下面的是一个链接 + console.log(res); + }); + } + } else if (plus.os.name == "iOS") { //苹果 + //因为ios查不到B款app在ios系统手机里面,其实下载了,也是检测不到,所以就不检测了 + //直接打开B款app,B款app没有的话,会进入回调报错,我们在回调去打开下载链接 + plus.runtime.launchApplication({ + action: "${schemes}://" + }, function(e) { + plus.runtime.openURL(`https://a.app.qq.com/o/simple.jsp?pkgname=${bagName}`, function(res) { + //进入后台小哥哥给我的appStore下载app链接,,让你们后台给你 + //这链接会判断你手机是ios还是Android,ios进入应用宝下载app + //跟上面的是一个链接 + console.log(res); + }); + }); + // } + + } + }, + // 三个列表跳页 onBookMore(e) { uni.navigateTo({ @@ -609,6 +677,19 @@