mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
提交
This commit is contained in:
@@ -196,8 +196,8 @@
|
||||
<div class="teacher-remark" v-html="item.authorInfo.sign"></div>
|
||||
</div>
|
||||
<div style="padding-top:15px">
|
||||
<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>
|
||||
<el-button v-if="current_teacher_follow" v-loading="loading" type="primary" @click="cancelFollow(item)" size="small">已关注</el-button>
|
||||
<el-button v-if="!current_teacher_follow" v-loading="loading" type="primary" @click="toFollow(item)" size="small">+ 关注</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -268,6 +268,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
controlHeight:400,//左边控制区域的内容高度
|
||||
timer: '',
|
||||
notePlay: null,
|
||||
@@ -422,9 +423,23 @@
|
||||
}, 1000*60);
|
||||
|
||||
},
|
||||
// 取消关注
|
||||
cancelFollow(item) {
|
||||
this.loading = true;
|
||||
apiFollow.remove(item.teacherId).then(res=>{
|
||||
this.loading = false;
|
||||
if(res.status == 200) {
|
||||
this.current_teacher_follow = false;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
//关注功能
|
||||
toFollow(item) {
|
||||
this.loading = true;
|
||||
apiFollow.save(item.teacherId).then(res => {
|
||||
this.loading = false;
|
||||
if (res.status == 200) {
|
||||
this.$message.success("关注成功!");
|
||||
this.current_teacher_follow = true;
|
||||
|
||||
Reference in New Issue
Block a user