Files
cunkebao_v3/Touchkebao/src/store/module/weChat/weChat.data.ts

60 lines
1.9 KiB
TypeScript
Raw Normal View History

import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
import { FriendsCircleItem } from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data";
export interface likeListItem {
createTime: number;
nickName: string;
wechatId: string;
}
// 评论数据类型
export interface CommentItem {
commentArg: number;
commentId1: number;
commentId2: number;
commentTime: number;
content: string;
nickName: string;
wechatId: string;
}
// 微信聊天相关的类型定义
export interface WeChatState {
// 当前选中的联系人/群组
currentContract: ContractData | weChatGroup | null;
// CurrentContact 相关方法
clearCurrentContact: () => void;
setCurrentContact: (
contract: ContractData | weChatGroup,
isExist?: boolean,
) => void;
// 当前聊天用户的消息列表(只存储当前聊天用户的消息)
currentMessages: ChatRecord[];
// 消息加载状态
messagesLoading: boolean;
isLoadingData: boolean;
currentGroupMembers: any[];
MomentCommon: FriendsCircleItem[];
// MomentCommon 相关方法
clearMomentCommon: () => void;
addMomentCommon: (moment: FriendsCircleItem[]) => void;
updateMomentCommon: (moments: FriendsCircleItem[]) => void;
MomentCommonLoading: boolean;
// MomentCommon 相关方法
updateMomentCommonLoading: (loading: boolean) => void;
updateLikeMoment: (snsId: string, likeList: likeListItem[]) => void;
updateComment: (snsId: string, commentList: CommentItem[]) => 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;
}