This commit is contained in:
zhaofang
2022-09-23 19:56:16 +08:00
parent c4bd52783d
commit ba5ed90fc6
4 changed files with 71 additions and 13 deletions

View File

@@ -4,7 +4,7 @@
<li class="follow-home-title tabs-index" @click="tagTab(1)">{{userInfo.aid == pageId ?'我关注的人':'他关注的人'}}<span v-if="active == 1" class="line"></span></li>
<li class="follow-home-title tabs-index" @click="tagTab(2)">{{userInfo.aid == pageId ?'关注我的人':'关注他的人'}}<span v-if="active == 2" class="line"></span></li>
</ul>
<div v-if="followList.length > 0">
<div v-show="active ==1">
<div class="follow-list" v-for="item in followList" :key="item.id">
<div style="width:60px;height:60">
<el-avatar shape="circle" style="width:60px;height:60px" size="small" :src="baseUrl+item.authorInfo.avatar" v-if="item.authorInfo.avatar"></el-avatar>
@@ -30,10 +30,36 @@
</div>
</div>
</div>
<div v-else class="home-no-list">
<div v-if="followList.length == 0">
<img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset="">
<p class="text">还没有关注的人</p>
</div>
<div v-show="active == 2">
<div class="follow-list" v-for="(maPage,index) in mypageList" :key="index">
<div style="width:60px;height:60">
<el-avatar shape="circle" style="width:60px;height:60px" size="small" :src="baseUrl+maPage.userFollow.authorInfo.avatar" v-if="maPage.userFollow.authorInfo.avatar"></el-avatar>
<div v-else class="uavatar">
<div v-if="maPage.userFollow.authorInfo.sex == null" style="border-radius: 50%;width: 60px;height: 60px;"></div>
<div v-else>
<div v-if="maPage.userFollow.authorInfo.sex === 1 "><img style="width:60px;height:60" src="../../../public/images/Avatarman.png" alt=""></div>
<div v-else><img style="width:60px;height:60" src="../../../public/images/Avatarwoman.png" alt=""></div>
</div>
</div>
<!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> -->
</div>
<div class="follow-center">
<p class="follow-home-title" style="font-size: 20px;margin-bottom: 12px;">{{maPage.userFollow.authorInfo.name}}
<!-- <img style="width:22px;height:22;vertical-align:middle" src="/images/homeWu/man.png" /> -->
</p>
<p class="portal-summary-text">{{maPage.userFollow.authorInfo.sign}}</p>
</div>
<div>
<el-button class="btn" icon="el-icon-plus" v-if="maPage.has">已关注</el-button>
<el-button type="primary" class="btn" v-else icon="el-icon-plus">关注他</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
@@ -62,7 +88,7 @@ import apiUser from "@/api/system/user.js";
active:1,
pageId:'',
// pageList:[],
// mypageList:[],
mypageList:[],
page:{
pageIndex:1,
pageSize:10,
@@ -96,9 +122,10 @@ import apiUser from "@/api/system/user.js";
if(res.status== 200) {
this.count = res.result.count;
res.result.list.forEach(item=>{
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
})
this.followList = res.result.list;
this.mypageList = res.result.list;
console.log(this.mypageList,'this.mypageList');
this.getUserData(res.result.list);
}
})
@@ -109,7 +136,7 @@ import apiUser from "@/api/system/user.js";
if(res.status== 200) {
this.count = res.result.count;
res.result.list.forEach(item=>{
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
})
this.followList = res.result.list;
this.getUserData(res.result.list);
@@ -121,7 +148,7 @@ import apiUser from "@/api/system/user.js";
if(this.active == 1) {
ids = list.map(item=> item.followId);
} else {
ids = list.map(item=> item.aid);
ids = list.map(item=> item.userFollow.aid);
}
apiUser.getByIds(ids).then(res => {
if (res.status == 200) {
@@ -130,8 +157,8 @@ import apiUser from "@/api/system/user.js";
if (this.active == 1 && author.aid == item.followId) {
item.authorInfo = author;
return true;
} else if ( this.active == 2 && author.aid == item.aid) {
item.authorInfo = author;
} else if ( this.active == 2 && author.aid == item.userFollow.aid) {
item.userFollow.authorInfo = author;
return true;
} else {
return false;