From 87dddd9dc130520f215d3f3b1aee2b3cbde4ae3c Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Mon, 17 Oct 2022 22:00:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=B7=B2=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/study/coursenew.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 16a7ca0a..afdc3e48 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -117,7 +117,7 @@
- +
@@ -196,7 +196,8 @@
- + 关注 + 已关注 + + 关注
@@ -272,6 +273,7 @@ notePlay: null, intTimeNote: '', courestab: 2,//默认是课程评论 + current_teacher_follow: false, // false - 已关注; true - 未关注 curCFile: { converStatus: 4, }, @@ -425,8 +427,10 @@ apiFollow.save(item.teacherId).then(res => { if (res.status == 200) { this.$message.success("关注成功!"); + this.current_teacher_follow = true; } else if(res.status == 400){ this.$message.warning(res.message); + this.current_teacher_follow = true; }else{ this.$message.error(res.message); } @@ -784,6 +788,14 @@ return false; } }); + + // 检查是否已关注 + apiFollow.checkFllow(item.teacherId).then(res => { + if (res.status == 200) { + this.current_teacher_follow = res.result ? true : false; + } + }) + }); } else { //console.log('加载课程信息失败:'+res.error); From 0422b6c9a71c4e06f8f023273a11a55ad257f3cb Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Mon, 17 Oct 2022 22:01:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=EF=BC=9AcheckFllow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/phase2/userfollow.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/api/phase2/userfollow.js b/src/api/phase2/userfollow.js index 50e14e3a..680e2a89 100644 --- a/src/api/phase2/userfollow.js +++ b/src/api/phase2/userfollow.js @@ -12,6 +12,16 @@ const save=function (followId){ return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/save?followId='+followId); } +/** + * 检查是否已关注 + * @param{ + * followId + * } + * */ +const checkFllow=function (followId){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/checkFllow?followId='+followId); +} + /** * 取消关注 * @@ -79,6 +89,6 @@ export default { mypage, ids, counts, - has + has, + checkFllow } -