From b6cd12a300ab35879ceffb68672153291d671ff8 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 10 Jul 2024 17:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91mall=20?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E4=BC=9A=E8=AF=9D=E7=BD=AE=E9=A1=B6=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=EF=BC=8C=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=8A=98=E5=8F=A0=E8=8F=9C=E5=8D=95=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE=E5=81=8F=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/kefu/components/KeFuConversationList.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/mall/promotion/kefu/components/KeFuConversationList.vue b/src/views/mall/promotion/kefu/components/KeFuConversationList.vue index e15c18fb..2a651672 100644 --- a/src/views/mall/promotion/kefu/components/KeFuConversationList.vue +++ b/src/views/mall/promotion/kefu/components/KeFuConversationList.vue @@ -72,18 +72,22 @@ import { KeFuConversationApi, KeFuConversationRespVO } from '@/api/mall/promotio import { useEmoji } from './tools/emoji' import { formatDate } from '@/utils/formatTime' import { KeFuMessageContentTypeEnum } from './tools/constants' +import { useAppStore } from '@/store/modules/app' defineOptions({ name: 'KeFuConversationList' }) const message = useMessage() // 消息弹窗 - +const appStore = useAppStore() const { replaceEmoji } = useEmoji() const conversationList = ref([]) // 会话列表 const activeConversationId = ref(-1) // 选中的会话 +const collapse = computed(() => appStore.getCollapse) // 折叠菜单 /** 加载会话列表 */ const getConversationList = async () => { - conversationList.value = await KeFuConversationApi.getConversationList() + const list = await KeFuConversationApi.getConversationList() + list.sort((a: KeFuConversationRespVO, _) => (a.adminPinned ? -1 : 1)) + conversationList.value = list } defineExpose({ getConversationList }) @@ -132,7 +136,7 @@ const rightClick = (mouseEvent: PointerEvent, item: KeFuConversationRespVO) => { showRightMenu.value = true rightMenuStyle.value = { top: mouseEvent.clientY - 110 + 'px', - left: mouseEvent.clientX - 80 + 'px' + left: collapse.value ? mouseEvent.clientX - 80 + 'px' : mouseEvent.clientX - 210 + 'px' } } /** 关闭右键菜单 */