From 2033faff08bbcde85a899e5d3aeb5b9c173aea13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Mon, 8 Sep 2025 09:45:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(weChat):=20=E4=BC=98=E5=8C=96=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E6=B6=88=E6=81=AF=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B9=B6=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 isLoadingData 状态控制滚动行为 修改 loadChatMessages 方法支持分页加载 移除聊天窗口的语音和视频通话按钮 更新构建产物文件引用 --- Cunkebao/dist/.vite/manifest.json | 26 +++++++------- Cunkebao/dist/index.html | 8 ++--- .../components/MessageRecord/index.tsx | 13 +++++-- .../pc/ckbox/components/ChatWindow/index.tsx | 15 -------- .../src/store/module/weChat/weChat.data.ts | 3 +- Cunkebao/src/store/module/weChat/weChat.ts | 34 +++++++++++++++---- 6 files changed, 56 insertions(+), 43 deletions(-) diff --git a/Cunkebao/dist/.vite/manifest.json b/Cunkebao/dist/.vite/manifest.json index efc8b536..e78197a2 100644 --- a/Cunkebao/dist/.vite/manifest.json +++ b/Cunkebao/dist/.vite/manifest.json @@ -1,18 +1,14 @@ { - "_charts-DmoeDXY2.js": { - "file": "assets/charts-DmoeDXY2.js", + "_charts-B9_ggjgM.js": { + "file": "assets/charts-B9_ggjgM.js", "name": "charts", "imports": [ - "_ui-D66ihimQ.js", + "_ui-CdpU1706.js", "_vendor-2vc8h_ct.js" ] }, - "_ui-D0C0OGrH.css": { - "file": "assets/ui-D0C0OGrH.css", - "src": "_ui-D0C0OGrH.css" - }, - "_ui-D66ihimQ.js": { - "file": "assets/ui-D66ihimQ.js", + "_ui-CdpU1706.js": { + "file": "assets/ui-CdpU1706.js", "name": "ui", "imports": [ "_vendor-2vc8h_ct.js" @@ -21,6 +17,10 @@ "assets/ui-D0C0OGrH.css" ] }, + "_ui-D0C0OGrH.css": { + "file": "assets/ui-D0C0OGrH.css", + "src": "_ui-D0C0OGrH.css" + }, "_utils-6WF66_dS.js": { "file": "assets/utils-6WF66_dS.js", "name": "utils", @@ -33,18 +33,18 @@ "name": "vendor" }, "index.html": { - "file": "assets/index-bW2KwNBi.js", + "file": "assets/index-BZQSHOtN.js", "name": "index", "src": "index.html", "isEntry": true, "imports": [ "_vendor-2vc8h_ct.js", "_utils-6WF66_dS.js", - "_ui-D66ihimQ.js", - "_charts-DmoeDXY2.js" + "_ui-CdpU1706.js", + "_charts-B9_ggjgM.js" ], "css": [ - "assets/index-BeKt58rz.css" + "assets/index-CciB7EKw.css" ] } } \ No newline at end of file diff --git a/Cunkebao/dist/index.html b/Cunkebao/dist/index.html index 168b3e09..6f790150 100644 --- a/Cunkebao/dist/index.html +++ b/Cunkebao/dist/index.html @@ -11,13 +11,13 @@ - + - - + + - +
diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageRecord/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageRecord/index.tsx index 426a5023..20c1f580 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageRecord/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageRecord/index.tsx @@ -13,13 +13,18 @@ interface MessageRecordProps { const MessageRecord: React.FC = ({ contract }) => { const messagesEndRef = useRef(null); const currentMessages = useWeChatStore(state => state.currentMessages); + const loadChatMessages = useWeChatStore(state => state.loadChatMessages); + const messagesLoading = useWeChatStore(state => state.messagesLoading); + const isLoadingData = useWeChatStore(state => state.isLoadingData); const currentGroupMembers = useWeChatStore( state => state.currentGroupMembers, ); useEffect(() => { - scrollToBottom(); - }, [currentMessages]); + if (isLoadingData) { + scrollToBottom(); + } + }, [currentMessages, isLoadingData]); const scrollToBottom = () => { messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }); @@ -192,7 +197,9 @@ const MessageRecord: React.FC = ({ contract }) => { return (
-
点击加载更早的信息
+
loadChatMessages(false)}> + 点击加载更早的信息{messagesLoading ? "中" : "1"} +
{groupMessagesByTime(currentMessages).map((group, groupIndex) => ( diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx index 9019a963..143198f6 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx @@ -68,21 +68,6 @@ const ChatWindow: React.FC = ({ contract }) => {
- -