|
@@ -31,18 +31,21 @@
|
|
|
></van-notice-bar>
|
|
|
|
|
|
<template v-if="showPage">
|
|
|
- <van-pull-refresh v-model="refreshing" @refresh="loadMore" class="flex-1">
|
|
|
- <van-list
|
|
|
- ref="chatListRef"
|
|
|
- class="h-full overflow-y-auto px-12 flex flex-col"
|
|
|
- :finished="true"
|
|
|
- finished-text=""
|
|
|
- >
|
|
|
- <template v-for="(message, index) in currConversationChatList" :key="index">
|
|
|
- <ChatMessage :show-name="true" :message="message"></ChatMessage>
|
|
|
- </template>
|
|
|
- </van-list>
|
|
|
- </van-pull-refresh>
|
|
|
+ <!-- <van-pull-refresh v-model="refreshing" @refresh="loadMore" class="flex-1"> -->
|
|
|
+ <!-- <van-list
|
|
|
+ ref="chatListRef"
|
|
|
+ class="h-full overflow-y-auto px-12 flex flex-col"
|
|
|
+ :finished="true"
|
|
|
+ finished-text=""
|
|
|
+ > -->
|
|
|
+ <!-- <van-pull-refresh v-model="refreshing" @refresh="loadMore" class="flex-1"> -->
|
|
|
+ <div ref="chatListRef" class="h-full overflow-y-auto px-12 flex flex-col">
|
|
|
+ <template v-for="(message, index) in currConversationChatList" :key="index">
|
|
|
+ <ChatMessage :show-name="true" :message="message"></ChatMessage>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <!-- </van-list> -->
|
|
|
+ <!-- </van-pull-refresh> -->
|
|
|
<div class="h-70 w-full bg-[#fff]"></div>
|
|
|
<div class="fixed bottom-0 left-0 right-0 w-full bg-[#fff]">
|
|
|
<ChatInput
|
|
@@ -70,7 +73,7 @@
|
|
|
import ChatMessage from './components/chat-message'
|
|
|
import ChatInput from './components/chat-input'
|
|
|
import { findHyperlinks } from '~/pages/chat/components/chat-message/link-message/handle'
|
|
|
-import {SocketEventsBus, XYWebSocket} from '~/utils/XYWebSocket'
|
|
|
+import { XYWebSocket } from '~/utils/XYWebSocket'
|
|
|
import { isValidJson } from '~/utils'
|
|
|
|
|
|
const route = useRoute()
|
|
@@ -257,7 +260,7 @@ const loadMore = async () => {
|
|
|
try {
|
|
|
refreshing.value = true
|
|
|
if (currConversationChatList.value.length) {
|
|
|
- if (totalCount.value === currConversationChatList.value.length) {
|
|
|
+ if (totalCount.value == currConversationChatList.value.length) {
|
|
|
// 已经加载了全部
|
|
|
} else {
|
|
|
await getChatList('more')
|
|
@@ -287,7 +290,7 @@ function getLocalId() {
|
|
|
|
|
|
onMounted(() => {
|
|
|
initGroupId()
|
|
|
-
|
|
|
+ try {
|
|
|
XYWebSocket.SocketEventsBus.on('chat-event', async (chat) => {
|
|
|
console.log('订阅群聊消息', chat)
|
|
|
const isCurrGroupId = chat.groupId && chat.groupId === groupId.value
|
|
@@ -302,7 +305,7 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+ } catch (error) {}
|
|
|
})
|
|
|
|
|
|
// 查寻群公告
|