mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 21:36:42 +08:00
修改关注的button,统一处理
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
</p>
|
||||
<p class="portal-summary-text">{{item.userFollow.authorInfo.sign}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<followButton :data="index" :has="item.has" :aid="item.userFollow.followId" @cancel="myCancelFollow" @add="myAddFollow"></followButton>
|
||||
</div>
|
||||
<!--
|
||||
<div v-if="pageId == userInfo.aid">
|
||||
<el-button plain class="btn" icon="el-icon-check" @click="cancel(item)">取消关注</el-button>
|
||||
</div>
|
||||
@@ -30,6 +34,7 @@
|
||||
<el-button class="btn" icon="el-icon-check" v-if="item.has" @click="cancel(item)">取消关注</el-button>
|
||||
<el-button type="primary" class="btn" v-else icon="el-icon-plus" @click="toFollow(item)">关注TA</el-button>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<!--分页没有加-->
|
||||
<div style="text-align: center; margin-top:57px;" v-show="follow.count > 0">
|
||||
@@ -68,8 +73,12 @@
|
||||
</p>
|
||||
<p class="portal-summary-text">{{maPage.userFollow.authorInfo.sign}}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<followButton :has="maPage.has" :aid="maPage.userFollow.aid"></followButton>
|
||||
</div>
|
||||
<!--
|
||||
<div v-if="pageId == userInfo.aid">
|
||||
|
||||
<el-button class="btn" icon="el-icon-check" v-if="maPage.has">已关注</el-button>
|
||||
<el-button type="primary" class="btn" v-else icon="el-icon-plus" @click="toFollow(maPage)">关注TA</el-button>
|
||||
</div>
|
||||
@@ -77,6 +86,7 @@
|
||||
<el-button plain class="btn" icon="el-icon-check" v-if="maPage.has" @click="cancel(maPage,2)">取消关注</el-button>
|
||||
<el-button type="primary" class="btn" v-else icon="el-icon-plus" @click="toFollow(maPage)">关注TA</el-button>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<!--分页没有加-->
|
||||
<div style="text-align: center; margin-top:57px;" v-show="page.count > 0">
|
||||
@@ -96,6 +106,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import followButton from "@/components/Follow/button.vue";
|
||||
import interactBar from "@/components/Portal/interactBar.vue";
|
||||
import author from "@/components/Portal/authorInfo.vue";
|
||||
import apiFollow from "@/api/phase2/userfollow.js"
|
||||
@@ -105,7 +116,7 @@ import apiUser from "@/api/system/user.js";
|
||||
name:"followList",
|
||||
components: {
|
||||
interactBar,
|
||||
// timeShow,
|
||||
followButton,
|
||||
author
|
||||
},
|
||||
computed:{
|
||||
@@ -157,6 +168,12 @@ import apiUser from "@/api/system/user.js";
|
||||
toHome(ava) {
|
||||
this.$router.push({path:this.$xpage.getHomePath(ava.aid)})
|
||||
},
|
||||
myCancelFollow(dataIndex){ //我关注的,我取消关注
|
||||
//this.follow.list.splice(dataIndex,1);
|
||||
},
|
||||
myAddFollow(dataIndex){ //我关注的,我取消关注
|
||||
//this.follow.list.splice(dataIndex,1);
|
||||
},
|
||||
toFollow(item) {
|
||||
let id = '';
|
||||
if(this.active == 2) {
|
||||
@@ -194,7 +211,7 @@ import apiUser from "@/api/system/user.js";
|
||||
} else {
|
||||
this.getPage();
|
||||
}
|
||||
|
||||
|
||||
// $this.follow.list.splice(idx,1);
|
||||
}
|
||||
})
|
||||
@@ -274,7 +291,7 @@ import apiUser from "@/api/system/user.js";
|
||||
} else {
|
||||
ids = list.map(item=> item.userFollow.followId);
|
||||
}
|
||||
|
||||
|
||||
apiUser.getByIds(ids).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach((item, index) => {
|
||||
|
||||
Reference in New Issue
Block a user