2026-01-20 19:36:49 +08:00
|
|
|
<template>
|
2026-02-03 09:59:49 +08:00
|
|
|
<view class="team-mate-container">
|
|
|
|
|
<view class="flex items-center justify-between">
|
|
|
|
|
<view class="text-lg font-semibold text-dark">团队成员</view>
|
|
|
|
|
<view class="flex items-center" @click="toTeamDetail()">
|
|
|
|
|
<view class="mr-5 text-base text-gray">团队详情</view>
|
|
|
|
|
<image class="arrow-icon" src="/static/home/右箭头-灰色.png" mode="aspectFit"></image>
|
|
|
|
|
</view>
|
2026-01-20 19:36:49 +08:00
|
|
|
</view>
|
2026-02-03 09:59:49 +08:00
|
|
|
<view class="mt-10">
|
|
|
|
|
<scroll-view scroll-x="true">
|
|
|
|
|
<view class="flex flex-nowrap pb-5">
|
|
|
|
|
<view v-for="i in teamates" :key="i.userid"
|
|
|
|
|
class="member-card flex flex-shrink-0 min-w-120 mr-15 p-15"
|
|
|
|
|
@click="toHomePage(i)">
|
|
|
|
|
<image class="flex-shrink-0 avatar mr-10" :src="i.avatar || '/static/default-avatar.png'" />
|
|
|
|
|
<view class="flex-grow flex flex-col justify-between">
|
|
|
|
|
<view>
|
|
|
|
|
<view class="leading-normal h-24 text-base font-semibold text-dark whitespace-nowrap">
|
|
|
|
|
{{ i.anotherName }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="max-w-100 h-21 leading-normal text-sm text-gray truncate">
|
|
|
|
|
{{ memberJob[i.userid] }}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="i.canAddFriend" class="add-friend-btn text-sm leading-none text-center text-primary"
|
|
|
|
|
@click.stop="toQrcode(i)">
|
|
|
|
|
添加好友
|
|
|
|
|
</view>
|
2026-01-20 19:36:49 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2026-02-03 09:59:49 +08:00
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
2026-01-20 19:36:49 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
2026-01-21 10:35:08 +08:00
|
|
|
import { computed, watch } from 'vue'
|
|
|
|
|
import useJob from '@/hooks/useJob';
|
2026-01-20 19:36:49 +08:00
|
|
|
const props = defineProps({
|
|
|
|
|
team: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: () => ({})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2026-01-21 10:35:08 +08:00
|
|
|
const { memberJob, memberList } = useJob();
|
|
|
|
|
|
2026-01-20 19:36:49 +08:00
|
|
|
const teamates = computed(() => {
|
|
|
|
|
const friendlyMembers = props.team && Array.isArray(props.team.friendlyMembers) ? props.team.friendlyMembers : [];
|
|
|
|
|
const memberList = props.team && Array.isArray(props.team.memberList) ? props.team.memberList : [];
|
|
|
|
|
return memberList.map(i => ({ ...i, canAddFriend: friendlyMembers.includes(i.userid) }))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function toHomePage(item) {
|
2026-01-21 10:35:08 +08:00
|
|
|
uni.navigateTo({ url: `/pages/team/homepage?userid=${item.userid}&corpId=${item.corpId}&showQrcode=${item.canAddFriend ? 'YES' : ''}` })
|
2026-01-20 19:36:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toQrcode(item) {
|
|
|
|
|
uni.navigateTo({ url: `/pages/team/friend?userid=${item.userid}&corpId=${item.corpId}` })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toTeamDetail() {
|
|
|
|
|
uni.navigateTo({ url: `/pages/team/team-detail?teamId=${props.team.teamId}&corpId=${props.team.corpId}&corpName=${encodeURIComponent(props.team.corpName)}` })
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-21 10:35:08 +08:00
|
|
|
watch(teamates, val => {
|
|
|
|
|
console.log(val)
|
|
|
|
|
memberList.value = val;
|
|
|
|
|
}, { immediate: true })
|
|
|
|
|
|
2026-01-20 19:36:49 +08:00
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
2026-02-03 09:59:49 +08:00
|
|
|
.team-mate-container {
|
|
|
|
|
margin: 0 30rpx;
|
|
|
|
|
margin-top: 24rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.arrow-icon {
|
|
|
|
|
width: 32rpx;
|
|
|
|
|
height: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.member-card {
|
|
|
|
|
background: white;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.member-card:active {
|
|
|
|
|
transform: translateY(-2rpx);
|
|
|
|
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-20 19:36:49 +08:00
|
|
|
.avatar {
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
height: 128rpx;
|
2026-02-03 09:59:49 +08:00
|
|
|
border-radius: 12rpx;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.add-friend-btn {
|
2026-02-03 10:45:54 +08:00
|
|
|
width: 144rpx;
|
|
|
|
|
padding: 10rpx 0;
|
|
|
|
|
background: #EAF2FF;
|
|
|
|
|
color: #2F6BFF;
|
|
|
|
|
border-radius: 12rpx;
|
|
|
|
|
margin-top: 10rpx;
|
|
|
|
|
font-weight: 500;
|
2026-01-20 19:36:49 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-21 10:35:08 +08:00
|
|
|
.h-24 {
|
2026-02-03 09:59:49 +08:00
|
|
|
min-height: 48rpx;
|
2026-01-21 10:35:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.h-21 {
|
2026-02-03 09:59:49 +08:00
|
|
|
min-height: 42rpx;
|
2026-01-21 10:35:08 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-20 19:36:49 +08:00
|
|
|
.min-w-120 {
|
2026-02-03 09:59:49 +08:00
|
|
|
min-width: 260rpx;
|
2026-01-20 19:36:49 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-21 10:35:08 +08:00
|
|
|
.max-w-100 {
|
|
|
|
|
max-width: 200rpx;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 09:59:49 +08:00
|
|
|
.mr-15 {
|
|
|
|
|
margin-right: 24rpx;
|
2026-01-20 19:36:49 +08:00
|
|
|
}
|
|
|
|
|
</style>
|