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

120 lines
2.5 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"
2024-08-09 22:39:27 +08:00
:content="friendData.nick"
2023-12-25 22:50:04 +08:00
placement="top"
>
2024-08-09 22:39:27 +08:00
{{ friendData.nick }}
2023-12-25 22:50:04 +08:00
</el-tooltip>
</div>
2024-01-27 10:55:12 +08:00
2024-08-09 22:39:27 +08:00
<!-- <el-tag effect="light" type="success"
2024-01-29 11:20:40 +08:00
>{{ friendData.level }}-{{friendData.levelName}} 等级</el-tag
2024-08-09 22:39:27 +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">
2024-08-09 22:39:27 +08:00
<div class="follow-text"> <el-icon class="el-icon--right"><Plus /></el-icon>关注</div>
2023-12-25 22:50:04 +08:00
</div>
</div>
</div>
</template>
<script setup name="RecommendFriend">
import { 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 {
2024-08-09 22:39:27 +08:00
width: 100px;
2023-12-25 22:50:04 +08:00
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;
}
}
}
2024-08-09 22:39:27 +08:00
.follow-text
{
font-size: small;
cursor: pointer;
}
2023-12-25 22:50:04 +08:00
</style>