perf: 群聊天点击头像进入个人对话

This commit is contained in:
kuaifan 2022-12-07 20:21:49 +08:00
parent 42031982a3
commit f4a7b8e2bb
4 changed files with 16 additions and 8 deletions

View File

@ -17,7 +17,7 @@
<Icon type="ios-chatbubbles" @click="openDialog"/>
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar-wrapper" :class="{'avatar-pointer': clickOpenDialog}" @click="onClickOpen">
<div v-if="showIcon" :class="boxClass" :style="boxStyle">
<em :style="spotStyle"></em>
<EAvatar v-if="showImg" ref="avatar" :class="{'avatar-default':isDefault}" :src="user.userimg" :size="avatarSize" :error="onError">
@ -69,6 +69,10 @@
type: Boolean,
default: false
},
clickOpenDialog: {
type: Boolean,
default: false
},
tooltipPlacement: {
type: String,
default: 'bottom'
@ -283,6 +287,12 @@
this.userResult(info);
},
onClickOpen() {
if (this.clickOpenDialog) {
this.openDialog()
}
},
openDialog() {
this.$store.dispatch("openDialogUserid", this.userid);
},

View File

@ -22,12 +22,7 @@
</div>
<template v-else>
<div class="dialog-avatar">
<UserAvatar
:userid="source.userid"
:tooltipDisabled="source.userid == userId || dialogData.type != 'group'"
:show-icon-menu="dialogData.type == 'group'"
:open-delay="100"
:size="30"/>
<UserAvatar :userid="source.userid" tooltip-disabled :click-open-dialog="dialogData.type == 'group'" :size="30"/>
</div>
<DialogView
:msg-data="source"

View File

@ -2,7 +2,7 @@
<div class="dialog-view" :class="viewClass" :data-id="msgData.id">
<!--昵称-->
<div v-if="dialogType === 'group'" class="dialog-username">
<UserAvatar :userid="msgData.userid" :show-icon="false" :show-name="true" :tooltip-disabled="true"/>
<UserAvatar :userid="msgData.userid" :show-icon="false" :show-name="true" click-open-dialog/>
</div>
<div

View File

@ -74,6 +74,9 @@
white-space: nowrap;
}
}
&.avatar-pointer {
cursor: pointer;
}
}
.common-avatar-transfer {
padding: 4px 2px;