feat(im): 对齐微信的图标展示

im
YunaiV 2026-05-01 08:17:24 +08:00
parent 92b1466597
commit 8564788b11
2 changed files with 23 additions and 13 deletions

View File

@ -67,15 +67,10 @@ const conversationStore = useConversationStore()
/** 消息 Tab 的红点:所有非免打扰会话的未读总和 */ /** 消息 Tab 的红点:所有非免打扰会话的未读总和 */
const totalUnread = computed(() => conversationStore.getTotalUnread) const totalUnread = computed(() => conversationStore.getTotalUnread)
/** /** 两个主 Tab用路由 name 而非 path避免前缀 / 嵌套调整后失效 */
* 两个主 Tab 的配置name 对应路由 ImHomeConversation/Contact
* name 而非 pathpath 后期容易变前缀调整嵌套加层name 更稳定
* icon 走通用 <Icon> 组件支持 iconify 全部前缀ep: / ant-design: / svg-icon:
* 通讯录用 ant-design:contacts-outlined与消息图标一眼区分好友 + 群聊在通讯录内分组展示
*/
const tabs = [ const tabs = [
{ name: 'ImHomeConversation', label: '消息', icon: 'ep:chat-dot-round' }, { name: 'ImHomeConversation', label: '消息', icon: 'ep:chat-round' },
{ name: 'ImHomeContact', label: '通讯录', icon: 'ant-design:contacts-outlined' } { name: 'ImHomeContact', label: '通讯录', icon: 'mingcute:contacts-line' }
] ]
/** 当前路由是否命中 Tab直接比对 route.name */ /** 当前路由是否命中 Tab直接比对 route.name */

View File

@ -19,20 +19,28 @@
</span> </span>
</span> </span>
<div class="flex gap-3 items-center"> <div class="flex gap-3 items-center">
<!-- 聊天历史从输入区底部工具栏挪到顶部右上角对齐微信 PC点击弹窗承接历史消息 --> <!-- 聊天历史 -->
<el-tooltip content="聊天历史" placement="bottom"> <el-tooltip content="聊天历史" placement="bottom">
<Icon <Icon
icon="ant-design:profile-outlined" icon="ep:chat-dot-round"
:size="20" :size="20"
class="message-panel__header-icon cursor-pointer" class="message-panel__header-icon cursor-pointer"
@click="historyVisible = true" @click="historyVisible = true"
/> />
</el-tooltip> </el-tooltip>
<!-- 信息抽屉入口群聊 / 私聊统一用 3 点图标对齐微信 PC <!-- 通话入口暂未开放先放占位图标对齐微信 PC -->
sideVisible 在群 / 私聊两个抽屉之间共用一个 ref v-if-else 决定挂哪个 --> <el-tooltip content="通话" placement="bottom">
<Icon
icon="ant-design:phone-outlined"
:size="20"
class="message-panel__header-icon cursor-pointer"
@click="handleCall"
/>
</el-tooltip>
<!-- 信息抽屉入口 -->
<el-tooltip :content="isGroup ? '群聊信息' : '聊天信息'" placement="bottom"> <el-tooltip :content="isGroup ? '群聊信息' : '聊天信息'" placement="bottom">
<Icon <Icon
icon="ant-design:more-outlined" icon="ant-design:ellipsis-outlined"
:size="20" :size="20"
class="message-panel__header-icon cursor-pointer" class="message-panel__header-icon cursor-pointer"
@click="toggleSide" @click="toggleSide"
@ -118,6 +126,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch, nextTick, computed } from 'vue' import { ref, watch, nextTick, computed } from 'vue'
import Icon from '@/components/Icon/src/Icon.vue' import Icon from '@/components/Icon/src/Icon.vue'
import { useMessage } from '@/hooks/web/useMessage'
import { useConversationStore } from '../../../../store/conversationStore' import { useConversationStore } from '../../../../store/conversationStore'
import { useFriendStore } from '../../../../store/friendStore' import { useFriendStore } from '../../../../store/friendStore'
@ -138,6 +147,7 @@ defineOptions({ name: 'ImMessagePanel' })
const conversationStore = useConversationStore() const conversationStore = useConversationStore()
const friendStore = useFriendStore() const friendStore = useFriendStore()
const groupStore = useGroupStore() const groupStore = useGroupStore()
const message = useMessage()
const listRef = ref<HTMLElement>() const listRef = ref<HTMLElement>()
const messages = computed(() => conversationStore.getActiveMessages) const messages = computed(() => conversationStore.getActiveMessages)
@ -256,6 +266,11 @@ function toggleSide() {
sideVisible.value = !sideVisible.value sideVisible.value = !sideVisible.value
} }
/** 通话入口:功能未开放,先弹提示占位 */
function handleCall() {
message.warning('通话功能暂未开放')
}
/** 当前私聊对应的好友(抽屉头部展示用) */ /** 当前私聊对应的好友(抽屉头部展示用) */
const privateFriend = computed(() => { const privateFriend = computed(() => {
const conversation = conversationStore.activeConversation const conversation = conversationStore.activeConversation