diff --git a/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx index 3507fc6d..dc4901e1 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/SidebarMenu/MessageList/index.tsx @@ -3,22 +3,22 @@ import { List, Avatar, Badge } from "antd"; import { UserOutlined, TeamOutlined } from "@ant-design/icons"; import { ContractData, weChatGroup } from "@/pages/pc/ckbox/data"; import { useWeChatStore } from "@/store/module/weChat/weChat"; +import { useCkChatStore } from "@/store/module/ckchat/ckchat"; + import styles from "./MessageList.module.scss"; import { formatWechatTime } from "@/utils/common"; -interface MessageListProps { - chatSessions: ContractData[] | weChatGroup[]; -} +interface MessageListProps {} -const MessageList: React.FC = ({ chatSessions }) => { +const MessageList: React.FC = () => { const { setCurrentContact, currentContract } = useWeChatStore(); - + const chatSessions = useCkChatStore(state => state.getChatSessions()); const onContactClick = (session: ContractData | weChatGroup) => { setCurrentContact(session); }; return (
( = ({ - loading = false, - currentContract, -}) => { - const chatSessions = useCkChatStore(state => state.getChatSessions()); +const SidebarMenu: React.FC = ({ loading = false }) => { const searchKeyword = useCkChatStore(state => state.searchKeyword); const setSearchKeyword = useCkChatStore(state => state.setSearchKeyword); const clearSearchKeyword = useCkChatStore(state => state.clearSearchKeyword); @@ -128,7 +122,7 @@ const SidebarMenu: React.FC = ({ const renderContent = () => { switch (activeTab) { case "chats": - return ; + return ; case "contracts": return ; case "groups": diff --git a/Cunkebao/src/pages/pc/ckbox/index.tsx b/Cunkebao/src/pages/pc/ckbox/index.tsx index 38c9cf84..0cbe80f4 100644 --- a/Cunkebao/src/pages/pc/ckbox/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/index.tsx @@ -64,7 +64,7 @@ const CkboxPage: React.FC = () => { {/* 左侧联系人边栏 */} - + {/* 主内容区 */} diff --git a/Cunkebao/src/store/module/ckchat/ckchat.ts b/Cunkebao/src/store/module/ckchat/ckchat.ts index 3bdf173a..b83cd436 100644 --- a/Cunkebao/src/store/module/ckchat/ckchat.ts +++ b/Cunkebao/src/store/module/ckchat/ckchat.ts @@ -389,6 +389,7 @@ export const useCkChatStore = createPersistStore( const newSession = state.chatSessions.map(item => item.id === session.id ? session : item, ); + console.log("新数组", newSession); set({ chatSessions: newSession }); }, // 删除聊天会话 diff --git a/Cunkebao/src/store/module/websocket/msgManage.ts b/Cunkebao/src/store/module/websocket/msgManage.ts index 423fab57..3146e213 100644 --- a/Cunkebao/src/store/module/websocket/msgManage.ts +++ b/Cunkebao/src/store/module/websocket/msgManage.ts @@ -46,6 +46,10 @@ const messageHandlers: Record = { // 在这里添加具体的处理逻辑 receivedMsg(message.friendMessage); }, + CmdFriendInfoChanged: message => { + // console.log("好友信息变更", message); + // 在这里添加具体的处理逻辑 + }, // 登录响应 CmdSignInResp: message => { @@ -67,6 +71,7 @@ const messageHandlers: Record = { // 在这里添加具体的处理逻辑 setVideoUrl(message.friendMessageId, message.url); }, + // 可以继续添加更多处理器... };