2025-09-11 15:00:57 +08:00
|
|
|
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
|
2025-09-17 10:20:31 +08:00
|
|
|
import { FriendsCircleItem } from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data";
|
|
|
|
|
|
2025-09-11 15:00:57 +08:00
|
|
|
// 微信聊天相关的类型定义
|
|
|
|
|
export interface WeChatState {
|
|
|
|
|
// 当前选中的联系人/群组
|
|
|
|
|
currentContract: ContractData | weChatGroup | null;
|
|
|
|
|
|
|
|
|
|
// 当前聊天用户的消息列表(只存储当前聊天用户的消息)
|
|
|
|
|
currentMessages: ChatRecord[];
|
|
|
|
|
// 清空当前联系人
|
|
|
|
|
clearCurrentContact: () => void;
|
|
|
|
|
// 消息加载状态
|
|
|
|
|
messagesLoading: boolean;
|
|
|
|
|
isLoadingData: boolean;
|
|
|
|
|
currentGroupMembers: any[];
|
|
|
|
|
|
2025-09-17 10:20:31 +08:00
|
|
|
// 朋友圈数据
|
|
|
|
|
MomentOfKf: FriendsCircleItem[]; // 客服自己的朋友圈
|
|
|
|
|
MomentOfSquare: FriendsCircleItem[]; // 朋友圈广场
|
|
|
|
|
MomentOfFriend: FriendsCircleItem[]; // 好友的朋友圈
|
|
|
|
|
|
2025-09-11 15:00:57 +08:00
|
|
|
// Actions
|
|
|
|
|
setCurrentContact: (
|
|
|
|
|
contract: ContractData | weChatGroup,
|
|
|
|
|
isExist?: boolean,
|
|
|
|
|
) => void;
|
|
|
|
|
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;
|
|
|
|
|
addMessage: (message: ChatRecord) => void;
|
|
|
|
|
receivedMsg: (message: ChatRecord) => void;
|
2025-09-17 10:20:31 +08:00
|
|
|
|
|
|
|
|
// 朋友圈相关方法
|
|
|
|
|
setMomentOfKf: (moments: FriendsCircleItem[]) => void;
|
|
|
|
|
setMomentOfSquare: (moments: FriendsCircleItem[]) => void;
|
|
|
|
|
setMomentOfFriend: (moments: FriendsCircleItem[]) => void;
|
|
|
|
|
addMomentOfKf: (moments: FriendsCircleItem[]) => void;
|
|
|
|
|
addMomentOfSquare: (moments: FriendsCircleItem[]) => void;
|
|
|
|
|
addMomentOfFriend: (moments: FriendsCircleItem[]) => void;
|
|
|
|
|
clearAllMoments: () => void;
|
2025-09-11 15:00:57 +08:00
|
|
|
}
|