From 8b2c24d7a19ea4efd362025f9fe8b92e2778ce30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Wed, 17 Sep 2025 10:20:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(wechat):=20=E6=B7=BB=E5=8A=A0=E6=9C=8B?= =?UTF-8?q?=E5=8F=8B=E5=9C=88=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在微信状态管理中新增朋友圈相关状态和方法 - 实现朋友圈数据获取、展示和交互功能 - 添加朋友圈API接口和WebSocket消息处理 - 优化朋友圈UI展示和样式 --- .../SidebarMenu/FriendsCicle/api.ts | 123 +++++++++++++++++- .../FriendsCicle/index.module.scss | 34 ++--- .../SidebarMenu/FriendsCicle/index.tsx | 15 ++- .../SidebarMenu/FriendsCicle/传参方法.txt | 88 ++++++++++++- .../src/store/module/weChat/weChat.data.ts | 16 +++ Touchkebao/src/store/module/weChat/weChat.ts | 39 ++++++ .../src/store/module/websocket/msgManage.ts | 52 +++++++- 7 files changed, 338 insertions(+), 29 deletions(-) diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/api.ts b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/api.ts index 8da04005..07573d7b 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/api.ts +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/api.ts @@ -1,6 +1,117 @@ -import request2 from "@/api/request2"; -import request from "@/api/request"; -// 静音聊天会话 -// export const muteChatSession = (chatId: string): Promise => { -// return request2(`/v1/chats/${chatId}/mute`, {}, "PUT"); -// }; +// 朋友圈相关的API接口 +import { useWebSocketStore } from "@/store/module/websocket/websocket"; + +// 朋友圈请求参数接口 +export interface FetchMomentParams { + wechatAccountId: number; + wechatFriendId?: number; + createTimeSec?: number; + prevSnsId?: number; + count?: number; + isTimeline?: boolean; + seq?: number; +} + +// 获取朋友圈数据 +export const fetchFriendsCircleData = async (params: FetchMomentParams) => { + const { sendCommand } = useWebSocketStore.getState(); + const requestData = { + cmdType: "CmdFetchMoment", + wechatAccountId: params.wechatAccountId, + wechatFriendId: params.wechatFriendId || 0, + createTimeSec: params.createTimeSec || Math.floor(Date.now() / 1000), + prevSnsId: params.prevSnsId || 0, + count: params.count || 10, + isTimeline: params.isTimeline || false, + seq: params.seq || Date.now(), + }; + + sendCommand("CmdFetchMoment", requestData); +}; + +// 点赞朋友圈 +export const likeMoment = async (params: { + wechatAccountId: number; + wechatFriendId?: number; + snsId: string; + seq?: number; +}) => { + const { sendCommand } = useWebSocketStore.getState(); + const requestData = { + cmdType: "CmdMomentInteract", + momentInteractType: 1, + wechatAccountId: params.wechatAccountId, + wechatFriendId: params.wechatFriendId || 0, + snsId: params.snsId, + seq: params.seq || Date.now(), + }; + + sendCommand("CmdMomentInteract", requestData); +}; + +// 取消点赞 +export const cancelLikeMoment = async (params: { + wechatAccountId: number; + wechatFriendId?: number; + snsId: string; + seq?: number; +}) => { + const { sendCommand } = useWebSocketStore.getState(); + const requestData = { + cmdType: "CmdMomentCancelInteract", + optType: 1, + wechatAccountId: params.wechatAccountId, + wechatFriendId: params.wechatFriendId || 0, + CommentId2: "", + CommentTime: 0, + snsId: params.snsId, + seq: params.seq || Date.now(), + }; + + sendCommand("CmdMomentCancelInteract", requestData); +}; + +// 评论朋友圈 +export const commentMoment = async (params: { + wechatAccountId: number; + wechatFriendId?: number; + snsId: string; + sendWord: string; + seq?: number; +}) => { + const { sendCommand } = useWebSocketStore.getState(); + const requestData = { + cmdType: "CmdMomentInteract", + wechatAccountId: params.wechatAccountId, + wechatFriendId: params.wechatFriendId || 0, + snsId: params.snsId, + sendWord: params.sendWord, + momentInteractType: 2, + seq: params.seq || Date.now(), + }; + + sendCommand("CmdMomentInteract", requestData); +}; + +// 撤销评论 +export const cancelCommentMoment = async (params: { + wechatAccountId: number; + wechatFriendId?: number; + snsId: string; + CommentTime: number; + seq?: number; +}) => { + const { sendCommand } = useWebSocketStore.getState(); + const requestData = { + cmdType: "CmdMomentCancelInteract", + optType: 2, + wechatAccountId: params.wechatAccountId, + wechatFriendId: params.wechatFriendId || 0, + CommentId2: "", + CommentTime: params.CommentTime, + snsId: params.snsId, + seq: params.seq || Date.now(), + }; + + sendCommand("CmdMomentCancelInteract", requestData); +}; diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss index ca122f5f..3838caca 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss @@ -55,7 +55,11 @@ display: flex; align-items: center; gap: 6px; - + .avatar { + width: 20px; + height: 20px; + border-radius: 5px; + } /* 特殊头像样式 */ .specialAvatar { background-color: #1890ff; @@ -174,7 +178,7 @@ margin-bottom: 8px; cursor: pointer; transition: transform 0.2s; - + &:hover { transform: scale(1.05); } @@ -246,10 +250,10 @@ .likeList { color: #576b95; - + span { cursor: pointer; - + &:hover { text-decoration: underline; } @@ -265,7 +269,7 @@ .commentUser { color: #576b95; cursor: pointer; - + &:hover { text-decoration: underline; } @@ -316,11 +320,11 @@ background: transparent; box-shadow: none; } - + :global(.ant-modal-header) { display: none; } - + :global(.ant-modal-close) { position: fixed; top: 20px; @@ -328,12 +332,12 @@ z-index: 1001; color: white; font-size: 24px; - + &:hover { background-color: rgba(255, 255, 255, 0.1); } } - + :global(.ant-modal-body) { padding: 0; } @@ -347,7 +351,7 @@ align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.9); - + .previewImage { max-width: 90vw; max-height: 90vh; @@ -355,7 +359,7 @@ border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); } - + .navButton { position: absolute; top: 50%; @@ -373,21 +377,21 @@ justify-content: center; transition: all 0.3s; z-index: 1000; - + &:hover { background: rgba(0, 0, 0, 0.7); transform: translateY(-50%) scale(1.1); } - + &.prevButton { left: 20px; } - + &.nextButton { right: 20px; } } - + .imageCounter { position: absolute; bottom: 20px; diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx index 2f432fe0..0890e8d3 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx @@ -12,6 +12,8 @@ import { import { InfiniteScroll } from "antd-mobile"; import styles from "./index.module.scss"; import { FriendsCircleItem, PaginationParams } from "./index.data"; +import { useCkChatStore } from "@/store/module/ckchat/ckchat"; + // 模拟朋友圈数据 const mockFriendsCircleData: FriendsCircleItem[] = [ { @@ -96,6 +98,11 @@ const mockFriendsCircleData: FriendsCircleItem[] = [ ]; const FriendsCircle: React.FC = () => { + const currentKf = useCkChatStore(state => + state.kfUserList.find(kf => kf.id === state.kfSelected), + ); + console.log(currentKf); + // 状态管理 const [myCircleData, setMyCircleData] = useState([]); const [squareData, setSquareData] = useState([]); @@ -466,7 +473,11 @@ const FriendsCircle: React.FC = () => { key: "1", label: (
- + 客服头像 我的朋友圈
), @@ -476,7 +487,7 @@ const FriendsCircle: React.FC = () => { key: "2", label: (
- + 朋友圈广场
), diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/传参方法.txt b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/传参方法.txt index 45bd2224..4fde2242 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/传参方法.txt +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/传参方法.txt @@ -1,4 +1,5 @@ =======================发送请求操作============================ +//我的朋友圈 { "cmdType": "CmdFetchMoment", "wechatAccountId": 300745, @@ -81,10 +82,91 @@ } =======================数据接收格式============================ //我的朋友圈接收的数据 -{"wechatFriendId":0,"wechatAccountId":300745,"result":[{"commentList":[],"createTime":1758011600,"likeList":[],"momentEntity":{"content":"回家第一时间宠幸露丝大小姐","createTime":1758011600,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270178949771902.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270179007509101.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270179101684338.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270179158569581.jpg"],"snsId":"-3699473895763463557","urls":["/sns/c/4/snst_14747270178949771902","/sns/9/1/snst_14747270179007509101","/sns/0/c/snst_14747270179101684338","/sns/3/c/snst_14747270179158569581"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699473895763463557","type":1},{"commentList":[],"createTime":1758010700,"likeList":[{"createTime":1758010805,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"暗黑老客户+1再+1❗❗ 老哥们滴滴我!立马解放你的双手!💪 全程售后!专业教程!最强社群! 让你收获满满![激动][激动]","createTime":1758010700,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699481452547067269/-3699481452547067269-14747262622224102007.jpg"],"snsId":"-3699481452547067269","urls":["/sns/e/3/snst_14747262622224102007"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699481452547067269","type":1},{"commentList":[],"createTime":1758001694,"likeList":[{"createTime":1758007726,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"🎉🎉🎉欢迎小伙伴加入暗黑秘密基地 感恩越来越多的小伙伴们的支持与信任!!!","createTime":1758001694,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699556994658192777/-3699556994658192777-14747187080143843961_hd.jpg"],"snsId":"-3699556994658192777","urls":["/sns/f/2/snst_14747187080143843961"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699556994658192777","type":1},{"commentList":[],"createTime":1757993594,"likeList":[],"momentEntity":{"content":"一键宏年卡+1 好的产品才有用户的持续复购 说的再多不如用户买的有说服力","createTime":1757993594,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699624939759586689/-3699624939759586689-14747119134792430192_hd.jpg"],"snsId":"-3699624939759586689","urls":["/sns/8/a/snst_14747119134792430192"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699624939759586689","type":1},{"commentList":[],"createTime":1757991794,"likeList":[],"momentEntity":{"content":"两个小时 637大卡 今天的努力也是给我自己最好的礼物✌🏻 坚持健身的第二年 打卡。","createTime":1757991794,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699640039516261772/-3699640039516261772-14747104035150705277_hd.jpg"],"snsId":"-3699640039516261772","urls":["/sns/9/9/snst_14747104035150705277"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699640039516261772","type":1},{"commentList":[],"createTime":1757989995,"likeList":[],"momentEntity":{"content":"老坑爹如果不靠谱,没有品质保障,客户会无限复购?","createTime":1757989995,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699655136960826771/-3699655136960826771-14747088937740284530_hd.jpg"],"snsId":"-3699655136960826771","urls":["/sns/0/1/snst_14747088937740284530"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699655136960826771","type":1},{"commentList":[],"createTime":1757973794,"likeList":[],"momentEntity":{"content":"[掘金计划] 每天10小时,月入2-5万元,AI助力高效成长,本赛季仅限10个名额。 AI智能推荐高收益玩法,团队协作更高效。每天10小时,连续多月满2万元,真实可查!","createTime":1757973794,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699791035173817740/-3699791035173817740-14746953039625400956_hd.jpg"],"snsId":"-3699791035173817740","urls":["/sns/e/8/snst_14746953039625400956"],"userName":"wxid_480es52qsj2812"},"snsId":"-3699791035173817740","type":1},{"commentList":[],"createTime":1757925222,"likeList":[],"momentEntity":{"content":"斑驳的光影,窗口的那串贝壳风铃,拨动它 像是拨了一下风。 那一瞬间,看不见的风,有了一份看得见的美","createTime":1757925222,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586467910261.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586593542780.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586637714046.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586695189114.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586744996467.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586788512375.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586839630449.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586888192632.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700198488152591764/-3700198488152591764-14746545586951631481.jpg"],"snsId":"-3700198488152591764","urls":["/sns/d/1/snst_14746545586467910261","/sns/b/f/snst_14746545586593542780","/sns/8/b/snst_14746545586637714046","/sns/5/a/snst_14746545586695189114","/sns/e/5/snst_14746545586744996467","/sns/9/4/snst_14746545586788512375","/sns/1/5/snst_14746545586839630449","/sns/2/c/snst_14746545586888192632","/sns/f/1/snst_14746545586951631481"],"userName":"wxid_480es52qsj2812"},"snsId":"-3700198488152591764","type":1},{"commentList":[],"createTime":1757924301,"likeList":[],"momentEntity":{"content":"暗黑3回归老哥+1 回归就要解放双手玩起来才快乐","createTime":1757924301,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700206211898461569/-3700206211898461569-14746537862867268216.jpg"],"snsId":"-3700206211898461569","urls":["/sns/1/9/snst_14746537862867268216"],"userName":"wxid_480es52qsj2812"},"snsId":"-3700206211898461569","type":1},{"commentList":[],"createTime":1757915295,"likeList":[],"momentEntity":{"content":"兄弟们冲! 老用户直接更新使用,新用户直接下单 找我找我","createTime":1757915295,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3700281761657965959/-3700281761657965959-14746462313007690367.jpg"],"snsId":"-3700281761657965959","urls":["/sns/b/6/snst_14746462313007690367"],"userName":"wxid_480es52qsj2812"},"snsId":"-3700281761657965959","type":1}],"seq":1097555,"cmdType":"CmdFetchMomentResult"} +{ + "wechatFriendId": 0, + "wechatAccountId": 300745, + "result": [{ + "commentList": [], + "createTime": 1758011600, + "likeList": [], + "momentEntity": { + "content": "回家第一时间宠幸露丝大小姐", + "createTime": 1758011600, + "lat": 0, + "lng": 0, + "location": "", + "objectType": 1, + "picSize": 0, + "resUrls": [ + "https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270178949771902.jpg", "https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270179007509101.jpg", "https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270179101684338.jpg", "https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699473895763463557/-3699473895763463557-14747270179158569581.jpg" + ], + "snsId": "-3699473895763463557", + "urls": ["/sns/c/4/snst_14747270178949771902", "/sns/9/1/snst_14747270179007509101", "/sns/0/c/snst_14747270179101684338", "/sns/3/c/snst_14747270179158569581"], + "userName": "wxid_480es52qsj2812" + }, + "snsId": "-3699473895763463557", + "type": 1 + }], + "seq": 1097555, + "cmdType": "CmdFetchMomentResult" +} //朋友圈广场接收的数据 -{"wechatFriendId":0,"wechatAccountId":300745,"result":[{"commentList":[],"createTime":1758018895,"likeList":[],"momentEntity":{"content":"还下雨不下雨,","createTime":1758018895,"lat":0,"lng":0,"location":"","objectType":15,"picSize":0,"resUrls":[],"snsId":"-3699412700395531708","urls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699412700395531708/-3699412700395531708.jpg"],"userName":"Danrtsey_DX"},"snsId":"-3699412700395531708","type":15},{"commentList":[],"createTime":1758018855,"likeList":[],"momentEntity":{"content":"可能又吃坏胃了,头疼睡一觉[难过]","createTime":1758018855,"lat":0,"lng":0,"location":"","objectType":2,"picSize":0,"resUrls":[],"snsId":"-3699413038769884681","urls":[],"userName":"wxid_a8jgtm8yidnl22"},"snsId":"-3699413038769884681","type":2},{"commentList":[],"createTime":1758018592,"likeList":[],"momentEntity":{"content":"应景","createTime":1758018592,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699415247729520128/-3699415247729520128-14747328826638930428.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699415247729520128/-3699415247729520128-14747328826647515654.jpg"],"snsId":"-3699415247729520128","urls":["/sns/3/9/snst_14747328826638930428","/sns/7/e/snst_14747328826647515654"],"userName":"wxid_ucu1xvjfn63v42"},"snsId":"-3699415247729520128","type":1},{"commentList":[],"createTime":1758018183,"likeList":[],"momentEntity":{"content":"烹牛宰羊且为乐,会须一饮三百杯。","createTime":1758018183,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699418672867036570/-3699418672867036570-14747325401547944476.jpg"],"snsId":"-3699418672867036570","urls":["/sns/8/9/snst_14747325401547944476"],"userName":"wxid_fipqq01ai0gz22"},"snsId":"-3699418672867036570","type":1},{"commentList":[],"createTime":1758018044,"likeList":[],"momentEntity":{"content":"日子越来越好","createTime":1758018044,"lat":0,"lng":0,"location":"","objectType":15,"picSize":0,"resUrls":[],"snsId":"-3699419838092201326","urls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699419838092201326/-3699419838092201326.jpg"],"userName":"wxid_ittr42760ndr12"},"snsId":"-3699419838092201326","type":15},{"commentList":[],"createTime":1758017939,"likeList":[],"momentEntity":{"content":"成都一日游结束","createTime":1758017939,"lat":0,"lng":0,"location":"","objectType":15,"picSize":0,"resUrls":[],"snsId":"-3699420727232490958","urls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699420727232490958/-3699420727232490958.jpg"],"userName":"wxid_lakjs3crxl1912"},"snsId":"-3699420727232490958","type":15},{"commentList":[],"createTime":1758017843,"likeList":[],"momentEntity":{"content":"陈奕迅𝑀𝑢𝑠𝑖𝑐▶⏸《富士山下》\nEason Chan ▶⏸《フジサンカした》","createTime":1758017843,"lat":35.50397,"lng":138.77206,"location":"qqmap_here:pds:place:392xn69v-4516cf1a94011846ca8a46d09a670067","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545533301427.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545597395633.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545647858171.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545699631791.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545805603322.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545853444782.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545914589693.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322545964986877.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421529075273033/-3699421529075273033-14747322546022330878.jpg"],"snsId":"-3699421529075273033","urls":["/sns/e/7/snst_14747322545533301427","/sns/a/8/snst_14747322545597395633","/sns/2/f/snst_14747322545647858171","/sns/3/6/snst_14747322545699631791","/sns/c/a/snst_14747322545805603322","/sns/0/1/snst_14747322545853444782","/sns/a/e/snst_14747322545914589693","/sns/8/a/snst_14747322545964986877","/sns/a/1/snst_14747322546022330878"],"userName":"wxid_a4ejtv88oiox11"},"snsId":"-3699421529075273033","type":1},{"commentList":[],"createTime":1758017831,"likeList":[],"momentEntity":{"content":"🎉233 网校 20 周年庆福利来啦!\n✨集卡活动正式启幕,Beats 耳机等你抽!\n📅9.16-10.13 听课 / 答题就能集卡,超简单~\n🎁集齐 “20 + 周年 + 生日 + 快乐”,10.13 开奖赢大奖!\n初级参与>>https://wx.233.com/cuxiao/card/?dm=cjjjs\n中级参与>>https://wx.233.com/cuxiao/card/?dm=zjjjs","createTime":1758017831,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421630230023502/-3699421630230023502-14747322447154786997.jpg","https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421630230023502/-3699421630230023502-14747322447208067581.jpg"],"snsId":"-3699421630230023502","urls":["/sns/6/6/snst_14747322447154786997","/sns/2/c/snst_14747322447208067581"],"userName":"25984982650643454@openim"},"snsId":"-3699421630230023502","type":1},{"commentList":[],"createTime":1758017829,"likeList":[],"momentEntity":{"content":"🎁233网校20周年庆典~小红书/抖音平台分享备考经验有好礼活动同步开启!🌟参与奖:分享即可获得500考证币!\n🌟纪念奖:限量前100名领取定制笔记本套装!\n🌟分享之星:限10名,达到要求,赢233定制POLO衫超有型~\n😘初中高级经济师都可以参与哦~\n✅立即扫码or戳>>#小程序://233网校/UX3pV8ZtJqm7ZID","createTime":1758017829,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699421652047744337/-3699421652047744337-14747322426170028726.jpg"],"snsId":"-3699421652047744337","urls":["/sns/e/3/snst_14747322426170028726"],"userName":"25984982650643454@openim"},"snsId":"-3699421652047744337","type":1},{"commentList":[],"createTime":1758017445,"likeList":[],"momentEntity":{"content":"每天最开心的就是去打🏸的路上","createTime":1758017445,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699424870875778437/-3699424870875778437-14747319203891196530.jpg"],"snsId":"-3699424870875778437","urls":["/sns/5/c/snst_14747319203891196530"],"userName":"wxid_j595b5cq0l4r12"},"snsId":"-3699424870875778437","type":1}],"seq":1098203,"cmdType":"CmdFetchMomentResult"} +{ + "wechatFriendId": 0, + "wechatAccountId": 300745, + "result": [{ + "commentList": [], + "createTime": 1758018895, + "likeList": [], + "momentEntity": { + "content": "还下雨不下雨,", + "createTime": 1758018895, + "lat": 0, + "lng": 0, + "location": "", + "objectType": 15, + "picSize": 0, + "resUrls": [], + "snsId": "-3699412700395531708", + "urls": ["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3699412700395531708/-3699412700395531708.jpg"], + "userName": "Danrtsey_DX" + }, + "snsId": "-3699412700395531708", + "type": 15 + }], + "seq": 1098203, + "cmdType": "CmdFetchMomentResult" +} //指定好友的朋友圈接收的数据 -{"wechatFriendId":21168549,"wechatAccountId":300745,"result":[{"commentList":[],"createTime":1757258659,"likeList":[{"createTime":1757315556,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"没看到血月[旺柴]","createTime":1757258659,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3705790026851937712/-3705790026851937712-14740954047910318662.jpg"],"snsId":"-3705790026851937712","urls":["/sns/3/3/snst_14740954047910318662"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3705790026851937712","type":1},{"commentList":[],"createTime":1757173578,"likeList":[{"createTime":1757315896,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"渡人先渡己,擒贼先擒王。","createTime":1757173578,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3706503736679198125/-3706503736679198125-14740240337645015630.jpg"],"snsId":"-3706503736679198125","urls":["/sns/2/7/snst_14740240337645015630"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3706503736679198125","type":1},{"commentList":[],"createTime":1756103121,"likeList":[{"createTime":1757316320,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"同事的椅子,和我的椅子🪑[Emm]","createTime":1756103121,"lat":0,"lng":0,"location":"","objectType":15,"picSize":0,"resUrls":[],"snsId":"-3715483378782432690","urls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3715483378782432690/-3715483378782432690.jpg"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3715483378782432690","type":15},{"commentList":[],"createTime":1755925942,"likeList":[{"createTime":1757316604,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"[偷笑]得罪了","createTime":1755925942,"lat":0,"lng":0,"location":"","objectType":15,"picSize":0,"resUrls":[],"snsId":"-3716969661828623794","urls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3716969661828623794/-3716969661828623794.jpg"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3716969661828623794","type":15},{"commentList":[],"createTime":1755349514,"likeList":[{"createTime":1757316905,"nickName":"老坑爹- 解放双手,释放时间","wechatId":"wxid_480es52qsj2812"}],"momentEntity":{"content":"吃个饭都能遇到妈祖[捂脸]","createTime":1755349514,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3721805097586781614/-3721805097586781614-14724938976789205577.jpg"],"snsId":"-3721805097586781614","urls":["/sns/8/1/snst_14724938976789205577"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3721805097586781614","type":1},{"commentList":[],"createTime":1755011580,"likeList":[],"momentEntity":{"content":"鸿鹄知春秋,撼海镇九流。","createTime":1755011580,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3724639891424341427/-3724639891424341427-14722104183322382918.jpg"],"snsId":"-3724639891424341427","urls":["/sns/1/c/snst_14722104183322382918"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3724639891424341427","type":1},{"commentList":[],"createTime":1751689130,"likeList":[],"momentEntity":{"content":"第一次遇到抽签车","createTime":1751689130,"lat":0,"lng":0,"location":"","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3752510624844148152/-3752510624844148152-14694233449528365640.jpg"],"snsId":"-3752510624844148152","urls":["/sns/5/4/snst_14694233449528365640"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3752510624844148152","type":1},{"commentList":[],"createTime":1751005570,"likeList":[],"momentEntity":{"content":"","coverImage":"","createTime":1751005570,"lat":0,"lng":0,"location":"","objectType":3,"picSize":0,"resUrls":[],"snsId":"-3758244736232910262","title":"00后设计师反杀白嫖客户!这操作太解气了","urls":["https://mp.weixin.qq.com/s?__biz=MzkyNDcxMTU2Ng==&mid=2247484123&idx=1&sn=f512ad8889386a60cc4611a2537a42dd&chksm=c039f613153a750c41814a322fc31402fc94195bea334a7096cf7581e24e46829c0c666288f3&mpshare=1&scene=2&srcid=0627yNiaqirYQWNgqRCIFKuI&sharer_shareinfo=752d2582f3449b7ac967108f6a260e0f&sharer_shareinfo_first=752d2582f3449b7ac967108f6a260e0f#rd"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3758244736232910262","type":3},{"commentList":[{"commentArg":2,"commentId1":0,"commentId2":289,"commentTime":1747578641,"content":"春末夏至流口水,一口一只姜母鸭。[旺柴]","nickName":"作品版权软著申请|许永平","wechatId":"wxid_dlhi90odctcl22"}],"createTime":1747570624,"likeList":[],"momentEntity":{"content":"春末夏初流口水,不如来吃姜母鸭。","createTime":1747570624,"lat":24.454126,"lng":118.07624,"location":"qqmap_2166690197341335509","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3787059149143993778/-3787059149143993778-14659684925183562310.jpg"],"snsId":"-3787059149143993778","urls":["/sns/8/b/snst_14659684925183562310"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3787059149143993778","type":1},{"commentList":[],"createTime":1747548845,"likeList":[],"momentEntity":{"content":"交流收获满满,下次见!","createTime":1747548845,"lat":25.097376,"lng":117.00555,"location":"qqmap_4576792767669052233","objectType":1,"picSize":0,"resUrls":["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3787241848206519721/-3787241848206519721-14659502226405986886.jpg"],"snsId":"-3787241848206519721","urls":["/sns/c/1/snst_14659502226405986886"],"userName":"wxid_dlhi90odctcl22"},"snsId":"-3787241848206519721","type":1}],"seq":1098348,"cmdType":"CmdFetchMomentResult"} +{ + "wechatFriendId": 21168549, + "wechatAccountId": 300745, + "result": [{ + "commentList": [], + "createTime": 1757258659, + "likeList": [{ + "createTime": 1757315556, + "nickName": "老坑爹- 解放双手,释放时间", + "wechatId": "wxid_480es52qsj2812" + }], + "momentEntity": { + "content": "没看到血月[旺柴]", + "createTime": 1757258659, + "lat": 0, + "lng": 0, + "location": "", + "objectType": 1, + "picSize": 0, + "resUrls": ["https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3705790026851937712/-3705790026851937712-14740954047910318662.jpg"], + "snsId": "-3705790026851937712", + "urls": ["/sns/3/3/snst_14740954047910318662"], + "userName": "wxid_dlhi90odctcl22" + }, + "snsId": "-3705790026851937712", + "type": 1 + }], + "seq": 1098348, + "cmdType": "CmdFetchMomentResult" +} diff --git a/Touchkebao/src/store/module/weChat/weChat.data.ts b/Touchkebao/src/store/module/weChat/weChat.data.ts index 7cdd4b73..c087b41e 100644 --- a/Touchkebao/src/store/module/weChat/weChat.data.ts +++ b/Touchkebao/src/store/module/weChat/weChat.data.ts @@ -1,4 +1,6 @@ import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data"; +import { FriendsCircleItem } from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data"; + // 微信聊天相关的类型定义 export interface WeChatState { // 当前选中的联系人/群组 @@ -13,6 +15,11 @@ export interface WeChatState { isLoadingData: boolean; currentGroupMembers: any[]; + // 朋友圈数据 + MomentOfKf: FriendsCircleItem[]; // 客服自己的朋友圈 + MomentOfSquare: FriendsCircleItem[]; // 朋友圈广场 + MomentOfFriend: FriendsCircleItem[]; // 好友的朋友圈 + // Actions setCurrentContact: ( contract: ContractData | weChatGroup, @@ -30,4 +37,13 @@ export interface WeChatState { setVideoUrl: (messageId: number, videoUrl: string) => void; addMessage: (message: ChatRecord) => void; receivedMsg: (message: ChatRecord) => void; + + // 朋友圈相关方法 + 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; } diff --git a/Touchkebao/src/store/module/weChat/weChat.ts b/Touchkebao/src/store/module/weChat/weChat.ts index 9ff04d61..7979911a 100644 --- a/Touchkebao/src/store/module/weChat/weChat.ts +++ b/Touchkebao/src/store/module/weChat/weChat.ts @@ -273,6 +273,45 @@ export const useWeChatStore = create()( messagesLoading: false, }); }, + + // 朋友圈相关方法 + setMomentOfKf: moments => { + set({ MomentOfKf: moments }); + }, + + setMomentOfSquare: moments => { + set({ MomentOfSquare: moments }); + }, + + setMomentOfFriend: moments => { + set({ MomentOfFriend: moments }); + }, + + addMomentOfKf: moments => { + set(state => ({ + MomentOfKf: [...state.MomentOfKf, ...moments], + })); + }, + + addMomentOfSquare: moments => { + set(state => ({ + MomentOfSquare: [...state.MomentOfSquare, ...moments], + })); + }, + + addMomentOfFriend: moments => { + set(state => ({ + MomentOfFriend: [...state.MomentOfFriend, ...moments], + })); + }, + + clearAllMoments: () => { + set({ + MomentOfKf: [], + MomentOfSquare: [], + MomentOfFriend: [], + }); + }, }), { name: "wechat-storage", diff --git a/Touchkebao/src/store/module/websocket/msgManage.ts b/Touchkebao/src/store/module/websocket/msgManage.ts index 3f70d947..05781cdb 100644 --- a/Touchkebao/src/store/module/websocket/msgManage.ts +++ b/Touchkebao/src/store/module/websocket/msgManage.ts @@ -3,8 +3,7 @@ import { deepCopy } from "@/utils/common"; import { WebSocketMessage } from "./websocket"; import { getkfUserList, asyncKfUserList } from "@/store/module/ckchat/ckchat"; import { Messages } from "./msg.data"; - -import { useWeChatStore } from "@/store/module/weChat/weChat"; +import { useWeChatStore } from "../weChat/weChat"; // 消息处理器类型定义 type MessageHandler = (message: WebSocketMessage) => void; const setVideoUrl = useWeChatStore.getState().setVideoUrl; @@ -77,7 +76,54 @@ const messageHandlers: Record = { CmdDownloadVideoResult: message => { // 在这里添加具体的处理逻辑 - setVideoUrl(message.friendMessageId, message.url); + console.log("视频下载结果:", message); + // setVideoUrl(message.friendMessageId, message.url); + }, + + // 朋友圈数据响应处理 + CmdFetchMomentResult: message => { + console.log("朋友圈数据响应", message); + const { wechatFriendId, wechatAccountId, result, isTimeline, seq } = + message; + const { + setMomentOfKf, + setMomentOfSquare, + setMomentOfFriend, + addMomentOfKf, + addMomentOfSquare, + addMomentOfFriend, + } = useWeChatStore.getState(); + + if (result && Array.isArray(result)) { + // 判断是否为第一页数据(通过seq或数据长度) + const isFirstPage = result.length > 0; + + // 根据wechatFriendId和isTimeline参数判断朋友圈类型 + if (wechatFriendId === 0) { + if (isTimeline) { + // 朋友圈广场 + if (isFirstPage) { + setMomentOfSquare(result); + } else { + addMomentOfSquare(result); + } + } else { + // 客服自己的朋友圈 + if (isFirstPage) { + setMomentOfKf(result); + } else { + addMomentOfKf(result); + } + } + } else { + // 指定好友的朋友圈 + if (isFirstPage) { + setMomentOfFriend(result); + } else { + addMomentOfFriend(result); + } + } + } }, // 可以继续添加更多处理器...