diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/Person/Person.module.scss b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/ProfileCard/Person.module.scss similarity index 100% rename from Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/Person/Person.module.scss rename to Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/ProfileCard/Person.module.scss diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/Person/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/ProfileCard/index.tsx similarity index 99% rename from Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/Person/index.tsx rename to Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/ProfileCard/index.tsx index c96eea65..ed60e655 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/Person/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/ProfileCard/index.tsx @@ -111,7 +111,7 @@ const Person: React.FC = ({ conRemark: remarkValue, // 使用当前编辑的备注值 alias: contract.alias, wechatId: contract.wechatId, - avatar: contract.avatar, + avatar: contract.avatar || contract.chatroomAvatar, phone: contract.phone || "-", email: contract.email || "-", department: contract.department || "-", diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx index edff2cd2..5470c535 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx @@ -20,7 +20,7 @@ import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data"; import styles from "./ChatWindow.module.scss"; import { useWebSocketStore } from "@/store/module/websocket/websocket"; import { formatWechatTime } from "@/utils/common"; -import Person from "./components/Person"; +import ProfileCard from "./components/ProfileCard"; import MessageEnter from "./components/MessageEnter"; import { useWeChatStore } from "@/store/module/weChat/weChat"; const { Header, Content } = Layout; @@ -44,6 +44,8 @@ const ChatWindow: React.FC = ({ const prevMessages = prevMessagesRef.current; // 检查是否有视频状态变化(从加载中变为已完成或开始加载) + console.log("currentMessages", currentMessages); + const hasVideoStateChange = currentMessages.some((msg, index) => { const prevMsg = prevMessages[index]; if (!prevMsg || prevMsg.id !== msg.id) return false; @@ -525,7 +527,7 @@ const ChatWindow: React.FC = ({ // 用于分组消息并添加时间戳的辅助函数 const groupMessagesByTime = (messages: ChatRecord[]) => { return messages.map(msg => ({ - time: formatWechatTime(msg.wechatTime), + time: formatWechatTime(msg?.wechatTime), messages: [msg], })); }; @@ -643,7 +645,7 @@ const ChatWindow: React.FC = ({ {/* 右侧个人资料卡片 */} - ()( } const messages = await getChatMessages(params); - set({ currentMessages: messages }); + set({ currentMessages: messages || [] }); } catch (error) { console.error("获取聊天消息失败:", error); } finally {