2025-09-11 15:00:57 +08:00
|
|
|
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
|
2025-09-17 17:21:20 +08:00
|
|
|
import {
|
|
|
|
|
CommentItem,
|
|
|
|
|
likeListItem,
|
|
|
|
|
FriendsCircleItem,
|
|
|
|
|
} from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data";
|
2025-09-11 15:00:57 +08:00
|
|
|
// 微信聊天相关的类型定义
|
|
|
|
|
export interface WeChatState {
|
2025-09-19 10:24:25 +08:00
|
|
|
//选择聊天记录
|
|
|
|
|
selectedMessage: ChatRecord[];
|
|
|
|
|
updateSelectedMessage: (message: ChatRecord[]) => void;
|
|
|
|
|
//选择用户或群
|
|
|
|
|
selectedContact: ContractData[] | weChatGroup[];
|
|
|
|
|
updateSelectedContact: (contact: ContractData[] | weChatGroup[]) => void;
|
|
|
|
|
|
|
|
|
|
openTransmitModal: boolean;
|
|
|
|
|
updateTransmitModal: (open: boolean) => void;
|
2025-09-11 15:00:57 +08:00
|
|
|
// 当前选中的联系人/群组
|
|
|
|
|
currentContract: ContractData | weChatGroup | null;
|
2025-09-17 10:44:12 +08:00
|
|
|
// CurrentContact 相关方法
|
|
|
|
|
clearCurrentContact: () => void;
|
|
|
|
|
setCurrentContact: (
|
|
|
|
|
contract: ContractData | weChatGroup,
|
|
|
|
|
isExist?: boolean,
|
|
|
|
|
) => void;
|
2025-09-11 15:00:57 +08:00
|
|
|
|
|
|
|
|
// 当前聊天用户的消息列表(只存储当前聊天用户的消息)
|
|
|
|
|
currentMessages: ChatRecord[];
|
2025-09-18 17:58:33 +08:00
|
|
|
// 添加消息
|
|
|
|
|
addMessage: (message: ChatRecord) => void;
|
|
|
|
|
// 替换消息
|
|
|
|
|
updateMessage: (messageId: number, updates: Partial<ChatRecord>) => void;
|
|
|
|
|
// 撤回消息
|
|
|
|
|
recallMessage: (messageId: number) => void;
|
2025-09-11 15:00:57 +08:00
|
|
|
// 消息加载状态
|
|
|
|
|
messagesLoading: boolean;
|
|
|
|
|
isLoadingData: boolean;
|
|
|
|
|
currentGroupMembers: any[];
|
2025-09-18 16:38:18 +08:00
|
|
|
showCheckbox: boolean;
|
|
|
|
|
updateShowCheckbox: (show: boolean) => void;
|
|
|
|
|
EnterModule: string;
|
|
|
|
|
// EnterModule 相关方法
|
|
|
|
|
updateEnterModule: (module: string) => void;
|
2025-09-17 10:44:12 +08:00
|
|
|
MomentCommon: FriendsCircleItem[];
|
|
|
|
|
// MomentCommon 相关方法
|
|
|
|
|
clearMomentCommon: () => void;
|
2025-09-17 14:57:58 +08:00
|
|
|
addMomentCommon: (moment: FriendsCircleItem[]) => void;
|
2025-09-17 10:44:12 +08:00
|
|
|
updateMomentCommon: (moments: FriendsCircleItem[]) => void;
|
2025-09-11 15:00:57 +08:00
|
|
|
|
2025-09-17 10:44:12 +08:00
|
|
|
MomentCommonLoading: boolean;
|
|
|
|
|
// MomentCommon 相关方法
|
|
|
|
|
updateMomentCommonLoading: (loading: boolean) => void;
|
2025-09-17 15:52:15 +08:00
|
|
|
updateLikeMoment: (snsId: string, likeList: likeListItem[]) => void;
|
2025-09-17 16:56:08 +08:00
|
|
|
updateComment: (snsId: string, commentList: CommentItem[]) => void;
|
2025-09-17 10:20:31 +08:00
|
|
|
|
2025-09-11 15:00:57 +08:00
|
|
|
loadChatMessages: (Init: boolean, To?: number) => Promise<void>;
|
|
|
|
|
SearchMessage: (params: {
|
|
|
|
|
From: number;
|
|
|
|
|
To: number;
|
|
|
|
|
keyword: string;
|
|
|
|
|
Count?: number;
|
|
|
|
|
}) => Promise<void>;
|
|
|
|
|
// 视频消息处理方法
|
|
|
|
|
setVideoLoading: (messageId: number, isLoading: boolean) => void;
|
|
|
|
|
setVideoUrl: (messageId: number, videoUrl: string) => void;
|
|
|
|
|
receivedMsg: (message: ChatRecord) => void;
|
|
|
|
|
}
|