followList.vue
2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!--
* @Date: 2022-04-28 18:37:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-06-24 22:23:24
* @FilePath: /tswj/src/views/me/followList.vue
* @Description: 文件描述
-->
<template>
<div class="follow-list-page">
<template v-for="(item) in followList" :key="item.id">
<div class="info van-hairline--bottom"
@click="go('/client/personIndex', { perf_id: item.id, type: 'read-only' })">
<van-row>
<van-col>
<van-image round width="50" height="50" :src="item.avatar ? item.avatar : icon_avatar"
style="padding-right: 1rem;" />
</van-col>
<van-col class="text-wrapper" span="18">
<div class="user-wrapper">
<div class="username">{{ item.name }}</div>
<div class="user-status">已关注</div>
</div>
<div class="address">{{ item.kg_name }}</div>
</van-col>
</van-row>
</div>
</template>
<van-empty v-if="emptyStatus" class="custom-image" :image="no_image" description="暂无关注" />
</div>
<div style="height: 2rem;" />
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import { ref, onMounted } from 'vue'
import icon_avatar from '@images/que-touxiang@2x.png'
import { myFollowAPI } from '@/api/C/me'
import { useGo } from '@/hooks/useGo'
const go = useGo()
const emptyStatus = ref(false);
const followList = ref([])
onMounted(async () => {
const { code, data } = await myFollowAPI()
if (code) {
followList.value = data;
emptyStatus.value = data.length ? false : true;
}
});
</script>
<style lang="less" scoped>
.follow-list-page {
.info {
padding: 2rem;
padding-right: 0;
.text-wrapper {
line-height: 1.5;
.username {
display: inline-block;
overflow: auto;
font-size: 1.15rem;
color: #222222;
}
.user-status {
float: right;
font-size: 0.8rem;
background-color: white;
border-radius: 15px;
padding: 5px 10px;
color: #999999;
border: 1px solid #EEEDED;
}
}
.address {
font-size: 0.85rem;
color: #999999;
}
}
}
</style>