diff --git a/src/views/mall/promotion/kefu/components/KeFuMessageList.vue b/src/views/mall/promotion/kefu/components/KeFuMessageList.vue index 9f24d247..8722f2c3 100644 --- a/src/views/mall/promotion/kefu/components/KeFuMessageList.vue +++ b/src/views/mall/promotion/kefu/components/KeFuMessageList.vue @@ -47,15 +47,18 @@ class="p-10px" > - -
+ + - + - + - - + + (item: any) => JSON.parse(item.content)) +const getMessageContent = computed(() => (item: any) => jsonParse(item.content)) /** 获得消息列表 */ const getMessageList = async () => { const res = await KeFuMessageApi.getKeFuMessagePage(queryParams) @@ -171,9 +180,6 @@ const getMessageList = async () => { } /** 添加消息 */ const pushMessage = (message: any) => { - if (message.conversationId !== conversation.value.id) { - return - } if (messageList.value.some((val) => val.id === message.id)) { return } @@ -193,6 +199,10 @@ const refreshMessageList = async (message?: any) => { } if (typeof message !== 'undefined') { + // 当前查询会话与消息所属会话不一致则不做处理 + if (message.conversationId !== conversation.value.id) { + return + } pushMessage(message) } else { queryParams.pageNo = 1 @@ -297,7 +307,7 @@ const handleScroll = debounce(({ scrollTop }) => { return } // 触顶自动加载下一页数据 - if (scrollTop === 0) { + if (Math.floor(scrollTop) === 0) { handleOldMessage() } const wrap = scrollbarRef.value?.wrapRef diff --git a/src/views/mall/promotion/kefu/components/message/MessageItem.vue b/src/views/mall/promotion/kefu/components/message/MessageItem.vue index c3033ac3..325a3639 100644 --- a/src/views/mall/promotion/kefu/components/message/MessageItem.vue +++ b/src/views/mall/promotion/kefu/components/message/MessageItem.vue @@ -1,18 +1,16 @@ diff --git a/src/views/mall/promotion/kefu/components/message/OrderItem.vue b/src/views/mall/promotion/kefu/components/message/OrderItem.vue index 47c8df80..5ee21f28 100644 --- a/src/views/mall/promotion/kefu/components/message/OrderItem.vue +++ b/src/views/mall/promotion/kefu/components/message/OrderItem.vue @@ -1,27 +1,29 @@