mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 05:16:43 +08:00
实现已关注处理
This commit is contained in:
@@ -196,7 +196,8 @@
|
|||||||
<div class="teacher-remark" v-html="item.authorInfo.sign"></div>
|
<div class="teacher-remark" v-html="item.authorInfo.sign"></div>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top:15px">
|
<div style="padding-top:15px">
|
||||||
<el-button type="primary" @click="toFollow(item)" size="small">+ 关注</el-button>
|
<el-button v-if="current_teacher_follow" type="primary" @click="toFollow(item)" size="small">已关注</el-button>
|
||||||
|
<el-button v-if="!current_teacher_follow" type="primary" @click="toFollow(item)" size="small">+ 关注</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -272,6 +273,7 @@
|
|||||||
notePlay: null,
|
notePlay: null,
|
||||||
intTimeNote: '',
|
intTimeNote: '',
|
||||||
courestab: 2,//默认是课程评论
|
courestab: 2,//默认是课程评论
|
||||||
|
current_teacher_follow: false, // false - 已关注; true - 未关注
|
||||||
curCFile: {
|
curCFile: {
|
||||||
converStatus: 4,
|
converStatus: 4,
|
||||||
},
|
},
|
||||||
@@ -425,8 +427,10 @@
|
|||||||
apiFollow.save(item.teacherId).then(res => {
|
apiFollow.save(item.teacherId).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.$message.success("关注成功!");
|
this.$message.success("关注成功!");
|
||||||
|
this.current_teacher_follow = true;
|
||||||
} else if(res.status == 400){
|
} else if(res.status == 400){
|
||||||
this.$message.warning(res.message);
|
this.$message.warning(res.message);
|
||||||
|
this.current_teacher_follow = true;
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(res.message);
|
this.$message.error(res.message);
|
||||||
}
|
}
|
||||||
@@ -784,6 +788,14 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 检查是否已关注
|
||||||
|
apiFollow.checkFllow(item.teacherId).then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.current_teacher_follow = res.result ? true : false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//console.log('加载课程信息失败:'+res.error);
|
//console.log('加载课程信息失败:'+res.error);
|
||||||
|
|||||||
Reference in New Issue
Block a user