Files
Yi.Admin/Yi.Bbs.Vue3/src/views/home/components/RecommendFriend/index.vue

115 lines
2.4 KiB
Vue
Raw Normal View History

2023-12-25 22:50:04 +08:00
<template>
<div class="friend-box">
<div class="left">
2024-01-09 21:46:09 +08:00
<UserInfoCard :userInfo="friendData" :iconUrl="userImageSrc" />
2023-12-25 22:50:04 +08:00
</div>
<div class="center">
<div class="top">
<div class="name">
<el-tooltip
class="box-item"
effect="dark"
:content="friendData.userName"
placement="top"
>
{{ friendData.userName }}
</el-tooltip>
</div>
2024-01-27 10:55:12 +08:00
2023-12-26 21:26:41 +08:00
<el-tag effect="light" type="success"
2024-01-29 11:20:40 +08:00
>{{ friendData.level }}-{{friendData.levelName}} 等级</el-tag
2023-12-26 21:26:41 +08:00
>
2024-01-27 10:55:12 +08:00
<UserLimitTag :userLimit="friendData.userLimit" />
2023-12-25 22:50:04 +08:00
</div>
</div>
<div class="right">
<div class="follow">
<el-icon class="el-icon--right"><Plus /></el-icon>
<div class="text">关注</div>
</div>
</div>
</div>
</template>
<script setup name="RecommendFriend">
import { defineProps, computed } from "vue";
2024-01-09 21:46:09 +08:00
import UserInfoCard from "@/components/UserInfoCard/index.vue";
2024-01-27 10:55:12 +08:00
import UserLimitTag from "@/components/UserLimitTag.vue";
2023-12-25 22:50:04 +08:00
const props = defineProps({
friendData: {
type: Array,
default: () => [],
},
});
const userImageSrc = computed(() => {
if (props.friendData.icon) {
return import.meta.env.VITE_APP_BASEAPI + "/file/" + props.friendData.icon;
} else {
2024-01-03 10:48:28 +08:00
return "acquiesce.png";
2023-12-25 22:50:04 +08:00
}
});
</script>
<style lang="scss">
.friend-box {
width: 100%;
height: 50px;
display: flex;
justify-content: space-around;
.left {
2024-01-07 22:31:52 +08:00
display: flex;
align-items: center;
2023-12-25 22:50:04 +08:00
flex: 1;
.icon {
2024-01-07 22:31:52 +08:00
width: 30px;
height: 30px;
2023-12-25 22:50:04 +08:00
img {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
}
.center {
flex: 4;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 0 10px;
.top {
height: 100%;
display: flex;
align-items: center;
.name {
width: 50px;
color: #252933;
margin-left: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
> .el-tag {
margin: 0 10px;
}
}
}
.right {
flex: 2;
display: flex;
align-items: center;
.follow {
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 16px;
color: #1171ee;
}
}
}
</style>