From 7724d60a053f5a29bd596b84bda7e91819f2a536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=98=E9=A3=8E?= Date: Thu, 18 Dec 2025 10:44:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=81=94=E7=B3=BB=E4=BA=BA?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=E8=8F=9C=E5=8D=95=E5=92=8C=E6=9C=8B?= =?UTF-8?q?=E5=8F=8B=E5=9C=88=E7=BB=84=E4=BB=B6=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=86=E7=BB=84=E6=88=90=E5=8A=9F=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E9=87=8D=E5=A4=8D=E8=B0=83=E7=94=A8=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E4=BB=A5=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C=EF=BC=8C=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E4=BB=A5=E4=BD=BF=E7=94=A8?= =?UTF-8?q?currentCustomer=E6=9B=BF=E4=BB=A3currentKf=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=95=B0=E6=8D=AE=E4=B8=80=E8=87=B4=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E5=8F=AF=E8=AF=BB=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ContactContextMenu/index.tsx | 43 +++++++++---------- .../FriendsCicle/components/friendCard.tsx | 30 ++++++------- .../SidebarMenu/FriendsCicle/index.data.ts | 6 ++- .../SidebarMenu/FriendsCicle/index.tsx | 16 +++---- 4 files changed, 46 insertions(+), 49 deletions(-) diff --git a/Touchkebao/src/components/ContactContextMenu/index.tsx b/Touchkebao/src/components/ContactContextMenu/index.tsx index bbb53788..6b1115a1 100644 --- a/Touchkebao/src/components/ContactContextMenu/index.tsx +++ b/Touchkebao/src/components/ContactContextMenu/index.tsx @@ -133,7 +133,7 @@ export const ContactContextMenu: React.FC = ({ if (onMoveGroup) { await onMoveGroup(contact, values.targetGroupId); - message.success("移动分组成功"); + message.success("移动分组成功"); } else { message.warning("移动分组功能未实现"); } @@ -176,23 +176,24 @@ export const ContactContextMenu: React.FC = ({ return ( <> {visible && ( - <> -
e.preventDefault()} - /> - + <> +
e.preventDefault()} + /> + )} @@ -215,11 +216,7 @@ export const ContactContextMenu: React.FC = ({ label="备注名称" rules={[{ max: 20, message: "备注名称不能超过20个字符" }]} > - + diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/components/friendCard.tsx b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/components/friendCard.tsx index ada75633..b9429fe1 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/components/friendCard.tsx +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/components/friendCard.tsx @@ -28,7 +28,7 @@ import { useWeChatStore } from "@/store/module/weChat/weChat"; export const FriendCard: React.FC = ({ monent, isNotMy = false, - currentKf, + currentCustomer, wechatFriendId, formatTime, }) => { @@ -44,15 +44,15 @@ export const FriendCard: React.FC = ({ const [commentText, setCommentText] = useState(""); const handleLike = (moment: FriendsCircleItem) => { - console.log(currentKf); + console.log(currentCustomer); //判断是否已经点赞了 const isLiked = moment?.likeList?.some( - (item: likeListItem) => item.wechatId === currentKf?.wechatId, + (item: likeListItem) => item.wechatId === currentCustomer?.wechatId, ); if (isLiked) { cancelLikeMoment({ - wechatAccountId: currentKf?.id || 0, + wechatAccountId: currentCustomer?.id || 0, wechatFriendId: wechatFriendId || 0, snsId: moment.snsId, seq: Date.now(), @@ -60,11 +60,11 @@ export const FriendCard: React.FC = ({ // 更新点赞 updateLikeMoment( moment.snsId, - moment.likeList.filter(v => v.wechatId !== currentKf?.wechatId), + moment.likeList.filter(v => v.wechatId !== currentCustomer?.wechatId), ); } else { likeMoment({ - wechatAccountId: currentKf?.id || 0, + wechatAccountId: currentCustomer?.id || 0, wechatFriendId: wechatFriendId || 0, snsId: moment.snsId, seq: Date.now(), @@ -74,8 +74,8 @@ export const FriendCard: React.FC = ({ ...moment.likeList, { createTime: Date.now(), - nickName: currentKf?.nickname || "", - wechatId: currentKf?.wechatId || "", + nickName: currentCustomer?.nickname || "", + wechatId: currentCustomer?.wechatId || "", }, ]); } @@ -89,7 +89,7 @@ export const FriendCard: React.FC = ({ // TODO: 调用发送评论的API commentMoment({ - wechatAccountId: currentKf?.id || 0, + wechatAccountId: currentCustomer?.id || 0, wechatFriendId: wechatFriendId || 0, snsId: monent.snsId, sendWord: commentText, @@ -104,8 +104,8 @@ export const FriendCard: React.FC = ({ commentId2: Date.now(), commentTime: Date.now(), content: commentText, - nickName: currentKf?.nickname || "", - wechatId: currentKf?.wechatId || "", + nickName: currentCustomer?.nickname || "", + wechatId: currentCustomer?.wechatId || "", }, ]); // 清空输入框并隐藏 @@ -118,7 +118,7 @@ export const FriendCard: React.FC = ({ // TODO: 调用删除评论的API comfirm("确定删除评论吗?").then(() => { cancelCommentMoment({ - wechatAccountId: currentKf?.id || 0, + wechatAccountId: currentCustomer?.id || 0, wechatFriendId: wechatFriendId || 0, snsId: snsId, seq: Date.now(), @@ -129,7 +129,7 @@ export const FriendCard: React.FC = ({ const commentList = monent.commentList.filter(v => { return !( v.commentId2 == comment.commentId2 && - v.wechatId == currentKf?.wechatId + v.wechatId == currentCustomer?.wechatId ); }); updateComment(snsId, commentList); @@ -271,7 +271,7 @@ export const MomentList: React.FC = ({ MomentCommon, MomentCommonLoading, formatTime, - currentKf, + currentCustomer, loadMomentData, }) => { return ( @@ -287,7 +287,7 @@ export const MomentList: React.FC = ({ monent={v} isNotMy={false} formatTime={formatTime} - currentKf={currentKf} + currentCustomer={currentCustomer} />
))} diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data.ts b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data.ts index d61c2870..12fa9c6b 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data.ts +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data.ts @@ -48,10 +48,12 @@ export interface ApiResponse { hasMore: boolean; } +import { Customer } from "@/store/module/weChat/customer.data"; + export interface FriendCardProps { monent: FriendsCircleItem; isNotMy?: boolean; - currentKf?: any; + currentCustomer?: Customer | null; wechatFriendId?: number; formatTime: (time: number) => string; } @@ -59,7 +61,7 @@ export interface FriendCardProps { export interface MomentListProps { MomentCommon: FriendsCircleItem[]; MomentCommonLoading: boolean; - currentKf?: any; + currentCustomer?: Customer | null; wechatFriendId?: number; formatTime: (time: number) => string; loadMomentData: (loadMore: boolean) => void; 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 4f99bb33..ec2d7c78 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 @@ -6,7 +6,7 @@ import { MomentList } from "./components/friendCard"; import dayjs from "dayjs"; import styles from "./index.module.scss"; import { fetchFriendsCircleData } from "./api"; -import { useCkChatStore } from "@/store/module/ckchat/ckchat"; +import { useCustomerStore } from "@/store/module/weChat/customer"; import { useWeChatStore } from "@/store/module/weChat/weChat"; interface FriendsCircleProps { @@ -14,9 +14,7 @@ interface FriendsCircleProps { } const FriendsCircle: React.FC = ({ wechatFriendId }) => { - const currentKf = useCkChatStore(state => - state.kfUserList.find(kf => kf.id === state.kfSelected), - ); + const currentCustomer = useCustomerStore(state => state.currentCustomer); const { clearMomentCommon, updateMomentCommonLoading } = useWeChatStore(); const MomentCommon = useWeChatStore(state => state.MomentCommon); const MomentCommonLoading = useWeChatStore( @@ -37,7 +35,7 @@ const FriendsCircle: React.FC = ({ wechatFriendId }) => { // 加载数据; const requestData = { cmdType: "CmdFetchMoment", - wechatAccountId: currentKf?.id || 0, + wechatAccountId: currentCustomer?.id || 0, wechatFriendId: wechatFriendId || 0, createTimeSec: Math.floor(dayjs().subtract(2, "month").valueOf() / 1000), prevSnsId: loadMore @@ -82,7 +80,7 @@ const FriendsCircle: React.FC = ({ wechatFriendId }) => {
客服头像 { // 如果图片加载失败,使用默认头像 @@ -97,7 +95,7 @@ const FriendsCircle: React.FC = ({ wechatFriendId }) => { ), children: ( = ({ wechatFriendId }) => { ), children: ( = ({ wechatFriendId }) => { ), children: (