mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 13:56:43 +08:00
提交修改
This commit is contained in:
@@ -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,//关联的类型
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="course-control">
|
||||
<div class="control-tab">
|
||||
<div @click="heartabone" :class="tab == 1 ? 'control-tab-active' : ' '">
|
||||
<div class="control-tab" v-if="contentList.length>0" >
|
||||
<div v-if="contentList.length>1" @click="heartabone" :class="tab == 1 ? 'control-tab-active' : ' '">
|
||||
<i class="el-icon-reading" style="margin-right:9px;margin-left:9px"></i>课程单元
|
||||
</div>
|
||||
<div @click="heartabtwo" :class="tab == 2 ? 'control-tab-active' : ' '">
|
||||
@@ -121,7 +121,7 @@
|
||||
<div class="catalog" v-if="courseInfo.type == 20">
|
||||
<div v-for="(item, index) in catalogTree" :key="index" :name="index">
|
||||
<div style="margin: 10px 0px;font-weight: 700;">{{item.section.name}}</div>
|
||||
<div class="units-info" :class="{'units-active':contentData.id == ele.id}" @click="showRes(ele,i,index)" v-for="(ele, i) in item.children" :key="i">
|
||||
<div class="units-info" :class="{'units-active':contentData.id == ele.id}" v-for="(ele, i) in item.children" :key="i" @click="showRes(ele,i,index)">
|
||||
<img v-if="contentData.id == ele.id" :src="`${webBaseUrl}/images/playicon.png`" alt=""> {{i+1}}.
|
||||
<span>{{ ele.contentName }}</span>
|
||||
</div>
|
||||
@@ -129,7 +129,7 @@
|
||||
</div>
|
||||
<div v-else class="catalog">
|
||||
<!-- contentList -->
|
||||
<div class="units-info" v-for="(list, index) in contentList" :key="index" :name="index" @click="showRes(list,i,index)" :class="{'units-active':contentData.id == list.id}">
|
||||
<div class="units-info" v-for="(list, index) in contentList" :key="index" :name="index" @click="showRes(list,-1,index)" :class="{'units-active':contentData.id == list.id}">
|
||||
<!-- <div class="units-info" :class="{'units-active':contentData.id == ele.id}" @click="showRes(ele,i,index)" v-for="(ele, i) in item.children" :key="i"> -->
|
||||
<img v-if="contentData.id == list.id" :src="`${webBaseUrl}/images/playicon.png`" alt=""> {{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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user