fix: 默认头像路径调整
This commit is contained in:
parent
5e6e77d6ce
commit
c8bc5b257a
@ -25,7 +25,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const list = computed(() => props.avatarList.map(i => i || '/static/default-avatar.svg'))
|
const list = computed(() => props.avatarList.map(i => i || '/static/default-avatar.png'))
|
||||||
|
|
||||||
const size = computed(() => {
|
const size = computed(() => {
|
||||||
const val = Number.isInteger(props.size) && props.size > 0 ? props.size : 144;
|
const val = Number.isInteger(props.size) && props.size > 0 ? props.size : 144;
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
<view v-for="i in teamates" :key="i.userid"
|
<view v-for="i in teamates" :key="i.userid"
|
||||||
class="member-card flex flex-shrink-0 min-w-120 mr-15 p-15"
|
class="member-card flex flex-shrink-0 min-w-120 mr-15 p-15"
|
||||||
@click="toHomePage(i)">
|
@click="toHomePage(i)">
|
||||||
<image class="flex-shrink-0 avatar mr-10" :src="i.avatar || '/static/default-avatar.svg'" />
|
<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 class="flex-grow flex flex-col justify-between">
|
||||||
<view>
|
<view>
|
||||||
<view class="member-name leading-normal h-24 text-base font-semibold text-dark whitespace-nowrap">
|
<view class="member-name leading-normal h-24 text-base font-semibold text-dark whitespace-nowrap">
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export default function useGroupAvatars() {
|
|||||||
const groupAvatarMap = ref({}) // { groupID: [avatarUrl1, avatarUrl2, ...] }
|
const groupAvatarMap = ref({}) // { groupID: [avatarUrl1, avatarUrl2, ...] }
|
||||||
const teamStore = useTeamStore()
|
const teamStore = useTeamStore()
|
||||||
const patientDefaultAvatar = '/static/default-patient-avatar.png'
|
const patientDefaultAvatar = '/static/default-patient-avatar.png'
|
||||||
const teamMemberDefaultAvatar = '/static/default-avatar.svg'
|
const teamMemberDefaultAvatar = '/static/default-avatar.png'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取单个群聊的头像列表
|
* 获取单个群聊的头像列表
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export default function useGroupChat(groupID) {
|
|||||||
const getUserAvatar = (userId) => {
|
const getUserAvatar = (userId) => {
|
||||||
const member = chatMember.value[userId]
|
const member = chatMember.value[userId]
|
||||||
if (!member) {
|
if (!member) {
|
||||||
return userId === openid.value ? '/static/default-patient-avatar.png' : '/static/default-avatar.svg'
|
return userId === openid.value ? '/static/default-patient-avatar.png' : '/static/default-avatar.png'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有头像且不为空字符串,返回头像
|
// 如果有头像且不为空字符串,返回头像
|
||||||
@ -55,7 +55,7 @@ export default function useGroupChat(groupID) {
|
|||||||
return member.avatar
|
return member.avatar
|
||||||
}
|
}
|
||||||
|
|
||||||
return member.isTeamMember ? '/static/default-avatar.svg' : '/static/default-patient-avatar.png'
|
return member.isTeamMember ? '/static/default-avatar.png' : '/static/default-patient-avatar.png'
|
||||||
}
|
}
|
||||||
// 获取群聊信息和成员头像
|
// 获取群聊信息和成员头像
|
||||||
async function getGroupInfo() {
|
async function getGroupInfo() {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<view v-if="member" class="flex flex-col h-full items-center justify-center">
|
<view v-if="member" class="flex flex-col h-full items-center justify-center">
|
||||||
<view class="business-card">
|
<view class="business-card">
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image class="mr-10 avatar" :src="member.avatar || '/static/default-avatar.svg'"></image>
|
<image class="mr-10 avatar" :src="member.avatar || '/static/default-avatar.png'"></image>
|
||||||
<view class="w-0 flex-grow leading-normal">
|
<view class="w-0 flex-grow leading-normal">
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<view class="mr-5 text-lg font-semibold text-dark">{{ member.anotherName }}</view>
|
<view class="mr-5 text-lg font-semibold text-dark">{{ member.anotherName }}</view>
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-for="i in teammate.leaders" :key="i._id" class="mt-12 flex p-10 border-primary rounded-sm"
|
<view v-for="i in teammate.leaders" :key="i._id" class="mt-12 flex p-10 border-primary rounded-sm"
|
||||||
@click="toHomePage(i.userid)">
|
@click="toHomePage(i.userid)">
|
||||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.svg'"></image>
|
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
||||||
<view class="w-0 flex-grow leading-normal">
|
<view class="w-0 flex-grow leading-normal">
|
||||||
<view class="flex items-center justify-between">
|
<view class="flex items-center justify-between">
|
||||||
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-for="i in teammate.members" :key="i._id" class="mt-12 flex p-10 border-primary rounded-sm"
|
<view v-for="i in teammate.members" :key="i._id" class="mt-12 flex p-10 border-primary rounded-sm"
|
||||||
@click="toHomePage(i.userid)">
|
@click="toHomePage(i.userid)">
|
||||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.svg'"></image>
|
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
||||||
<view class="w-0 flex-grow leading-normal">
|
<view class="w-0 flex-grow leading-normal">
|
||||||
<view class="flex items-center justify-between">
|
<view class="flex items-center justify-between">
|
||||||
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
||||||
|
|||||||
@ -144,7 +144,7 @@ function mergeConversationData(conversation, groupDetailsMap) {
|
|||||||
name: formatConversationName(groupDetail),
|
name: formatConversationName(groupDetail),
|
||||||
|
|
||||||
// 更新头像(优先使用已有头像,避免闪动)
|
// 更新头像(优先使用已有头像,避免闪动)
|
||||||
avatar: conversation.avatar || groupDetail.patient?.avatar || '/static/default-avatar.svg',
|
avatar: conversation.avatar || groupDetail.patient?.avatar || '/static/default-avatar.png',
|
||||||
|
|
||||||
// 【修复】保留未读消息数(确保不被覆盖)
|
// 【修复】保留未读消息数(确保不被覆盖)
|
||||||
unreadCount: conversation.unreadCount || 0
|
unreadCount: conversation.unreadCount || 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user