feat(朋友圈): 实现朋友圈点赞功能并优化组件结构

重构朋友圈组件结构,将核心逻辑拆分为独立组件。主要变更包括:
1. 新增点赞功能及相关API接口
2. 修改snsId类型从number到string以兼容接口
3. 在store中新增updateLikeMoment方法处理点赞状态
4. 提取FriendCard和MomentList为独立组件
5. 优化代码结构提升可维护性
This commit is contained in:
2025-09-17 15:52:15 +08:00
parent 680c16c7da
commit 3477b5d575
9 changed files with 814 additions and 273 deletions

View File

@@ -1,5 +1,10 @@
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
import { FriendsCircleItem } from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data";
interface likeListItem {
createTime: number;
nickName: string;
wechatId: string;
}
// 微信聊天相关的类型定义
export interface WeChatState {
// 当前选中的联系人/群组
@@ -26,6 +31,7 @@ export interface WeChatState {
MomentCommonLoading: boolean;
// MomentCommon 相关方法
updateMomentCommonLoading: (loading: boolean) => void;
updateLikeMoment: (snsId: string, likeList: likeListItem[]) => void;
loadChatMessages: (Init: boolean, To?: number) => Promise<void>;
SearchMessage: (params: {