diff --git a/src/components/Portal/interactBar.vue b/src/components/Portal/interactBar.vue index f95be3bb..474e3aa7 100644 --- a/src/components/Portal/interactBar.vue +++ b/src/components/Portal/interactBar.vue @@ -348,11 +348,18 @@ export default { this.$store.dispatch("unicomPraises",false) } //自己给自己点赞不算 - if(this.userInfo.aid!=this.data.sysCreateAid){ + let authorId=this.data.sysCreateAid; + if(this.type==3){ //案例取作者id + authorId=this.data.authorId; + }else if(this.type==1){ //课程取老师的id + // 目前页面上没有点赞的地方,课程有多个老师,也要给每个老师加吗? + //console.log(this.data,'点赞中课程的传的数据') + } + if(this.userInfo.aid!=authorId){ let event = { key: "CancelPraise",// title: "取消点赞",//事件的标题 - parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value + parameters:"author:"+authorId,//用户自定义参数 name:value,name:value content: "取消点赞"+postData.title,//事件的内容 objId: this.data.id,//关联的id objType: this.type,//关联的类型 diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 7968a9d9..81ae32ba 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -106,8 +106,8 @@
-
-
+
+
课程单元
@@ -121,7 +121,7 @@
{{item.section.name}}
-
+
{{i+1}}. {{ ele.contentName }}
@@ -129,7 +129,7 @@
-
+
{{index+1}}. {{ list.contentName }} @@ -476,7 +476,8 @@ toResContent=c; } }); - if(toResContent!=null){ + if(toResContent){ + this.changePlayRes(toResContent); //this.onPlayerPlay(); setTimeout(() => { @@ -527,6 +528,7 @@ }, //替换播放区域 changePlayRes(r){ + if(this.appendStudyOtherHandle!=null){ window.clearTimeout(this.appendStudyOtherHandle); } @@ -623,7 +625,7 @@ }) }, showRes(r, i, index) { //i:子节下标,index:章下标 - if (i != undefined && index != undefined && r.status < 9) { + if (i != undefined && i!=-1 && index != undefined && r.status < 9) { if (this.courseInfo.orderStudy) { //判断上个是否学完 if (i == 0) { @@ -1018,10 +1020,20 @@ } }, loadData() { + let $this=this; apiCoursePortal.detail(this.courseId, false).then(rs => { if (rs.status == 200) { + if(rs.result.contents.length==0){ + $this.$message.error('课程内容已删除或课程已不再使用'); + return; + } //设置必须的字段 + if(rs.result.contents.length==1){ + $this.tab=2; + //console.log('内容只有一个'); + } if (rs.result.course.type == 20) { //有目录课程 + rs.result.sections.forEach(sec => { sec.status = 0; //加入状态表未开始 rs.result.contents.forEach(c => { @@ -1117,13 +1129,16 @@ }); if (this.courseInfo.type == 10) { + ///console.log(this.contentList[0],'ccccc11111') this.showRes(this.contentList[0]); } else { //如果没有,就定位第一项内容 if (playIndex === -1) { // this.showRes(this.contentList[0]); + //console.log(this.catalogTree,'ccccc22222') this.showRes(this.catalogTree[0].children[0]) } else { + //console.log(this.contentList[0],'ccccc3333') this.showRes(this.contentList[playIndex]); } }