= ({ contract }) => {
/>
-
-
- 转给他人
-
-
-
- 聊天记录
-
+
{
+ console.log("转接数据:", data);
+ // 这里可以添加实际的转接逻辑
+ }}
+ onReturn={() => {
+ console.log("执行一键转回操作");
+ // 这里可以添加实际的转回逻辑
+ }}
+ />
+ {
+ console.log("查找数据:", data);
+ // 这里可以添加实际的查找逻辑
+ }}
+ />
diff --git a/Cunkebao/src/store/module/weChat/weChat.data.ts b/Cunkebao/src/store/module/weChat/weChat.data.ts
index 07ef36ed..f7839ef0 100644
--- a/Cunkebao/src/store/module/weChat/weChat.data.ts
+++ b/Cunkebao/src/store/module/weChat/weChat.data.ts
@@ -18,7 +18,12 @@ export interface WeChatState {
isExist?: boolean,
) => void;
loadChatMessages: (Init: boolean, To?: number) => Promise;
-
+ SearchMessage: (params: {
+ From: number;
+ To: number;
+ keyword: string;
+ Count?: number;
+ }) => Promise;
// 视频消息处理方法
setVideoLoading: (messageId: number, isLoading: boolean) => void;
setVideoUrl: (messageId: number, videoUrl: string) => void;
diff --git a/Cunkebao/src/store/module/weChat/weChat.ts b/Cunkebao/src/store/module/weChat/weChat.ts
index b48102e2..fa537c1d 100644
--- a/Cunkebao/src/store/module/weChat/weChat.ts
+++ b/Cunkebao/src/store/module/weChat/weChat.ts
@@ -98,6 +98,50 @@ export const useWeChatStore = create()(
set({ messagesLoading: false });
}
},
+ SearchMessage: async ({
+ From = 1,
+ To = 4704624000000,
+ keyword = "",
+ Count = 20,
+ }: {
+ From: number;
+ To: number;
+ keyword: string;
+ Count?: number;
+ }) => {
+ const state = useWeChatStore.getState();
+ const contact = state.currentContract;
+ set({ messagesLoading: true });
+
+ try {
+ const params: any = {
+ wechatAccountId: contact.wechatAccountId,
+ From,
+ To,
+ keyword,
+ Count,
+ olderData: true,
+ };
+
+ if ("chatroomId" in contact && contact.chatroomId) {
+ params.wechatChatroomId = contact.id;
+ const messages = await getChatroomMessages(params);
+ const currentGroupMembers = await getGroupMembers({
+ id: contact.id,
+ });
+ set({ currentMessages: messages || [], currentGroupMembers });
+ } else {
+ params.wechatFriendId = contact.id;
+ const messages = await getChatMessages(params);
+ set({ currentMessages: messages || [] });
+ }
+ set({ messagesLoading: false });
+ } catch (error) {
+ console.error("获取聊天消息失败:", error);
+ } finally {
+ set({ messagesLoading: false });
+ }
+ },
setMessageLoading: loading => {
set({ messagesLoading: Boolean(loading) });