From adc5dd1742f5c0564221907fd5b9d01c929fdb77 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: Fri, 26 Sep 2025 15:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=84=AA=E5=8C=96=E5=B0=8E=E8=88=AA=E7=B5=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=9A=E8=AA=BF=E6=95=B4=E6=8C=89=E9=88=95=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA=E5=85=A7=E5=AE=B9=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=94=A8?= =?UTF-8?q?=E6=88=B6=E4=BF=A1=E6=81=AF=E9=A1=AF=E7=A4=BA=EF=BC=8C=E4=B8=A6?= =?UTF-8?q?=E5=9C=A8=E6=A8=A3=E5=BC=8F=E4=B8=AD=E5=A2=9E=E5=8A=A0=E9=96=93?= =?UTF-8?q?=E8=B7=9D=E8=A8=AD=E7=BD=AE=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8?= =?UTF-8?q?=E6=88=B6=E7=95=8C=E9=9D=A2=E5=8F=8B=E5=A5=BD=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NavCommon/index.module.scss | 15 +++++- .../pc/ckbox/components/NavCommon/index.tsx | 47 ++++++++++--------- Touchkebao/src/pages/pc/ckbox/weChat/main.ts | 6 ++- .../src/store/module/ckchat/ckchat.data.ts | 1 + Touchkebao/src/store/module/ckchat/ckchat.ts | 6 +++ 5 files changed, 48 insertions(+), 27 deletions(-) diff --git a/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.module.scss b/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.module.scss index 77ab9442..a8c4e452 100644 --- a/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.module.scss +++ b/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.module.scss @@ -79,6 +79,7 @@ display: flex; align-items: center; padding: 8px 0; + gap: 26px; .suanli { display: flex; align-items: center; @@ -131,10 +132,20 @@ .userSection { display: flex; - align-items: center; gap: 12px; cursor: pointer; - padding: 8px 16px; + .userInfo2 { + line-height: 1; + padding-top: 5px; + font-size: 14px; + .userNickname { + margin-bottom: 4px; + } + .userAccount { + font-size: 12px; + color: #888; + } + } } .userNickname { diff --git a/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx b/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx index b8e632b9..f1dc087f 100644 --- a/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx +++ b/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Layout, Drawer, Avatar, Space, Button, Badge, Dropdown } from "antd"; import { - MenuOutlined, + BarChartOutlined, UserOutlined, BellOutlined, LogoutOutlined, @@ -90,24 +90,20 @@ const NavCommon: React.FC = ({ title = "触客宝" }) => { <>
- {!isWeChat() ? ( - + {title}
@@ -124,14 +120,14 @@ const NavCommon: React.FC = ({ title = "触客宝" }) => { -
{ navigate("/pc/commonConfig"); }} + icon={} > - -
+ 全局配置 + = ({ title = "触客宝" }) => { src={user?.avatar} className={styles.avatar} /> + +
+
{user.username}
+
高级客服专员
+
diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/main.ts b/Touchkebao/src/pages/pc/ckbox/weChat/main.ts index 10e050c1..93bee0a9 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/main.ts +++ b/Touchkebao/src/pages/pc/ckbox/weChat/main.ts @@ -6,11 +6,12 @@ import { asyncCountLables, useCkChatStore, updateIsLoadWeChat, + getIsLoadWeChat, } from "@/store/module/ckchat/ckchat"; import { useWebSocketStore } from "@/store/module/websocket/websocket"; import { useUserStore } from "@/store/module/user"; import { weChatGroupService, contractService } from "@/utils/db"; -const isLoadWeChat = useCkChatStore.getState().isLoadWeChat; + import { loginWithToken, getControlTerminalList, @@ -32,7 +33,8 @@ export const chatInitAPIdata = async () => { try { let contractList = []; let groupList = []; - if (isLoadWeChat) { + + if (getIsLoadWeChat()) { //获取联系人列表 contractList = await contractService.findAll(); //获取群列表 diff --git a/Touchkebao/src/store/module/ckchat/ckchat.data.ts b/Touchkebao/src/store/module/ckchat/ckchat.data.ts index 868c582e..9eeebffa 100644 --- a/Touchkebao/src/store/module/ckchat/ckchat.data.ts +++ b/Touchkebao/src/store/module/ckchat/ckchat.data.ts @@ -35,6 +35,7 @@ export interface CkChatState { isLoggedIn: boolean; searchKeyword: string; isLoadWeChat: boolean; + getIsLoadWeChat: () => boolean; updateIsLoadWeChat: (isLoadWeChat: boolean) => void; contractList: ContractData[]; chatSessions: any[]; diff --git a/Touchkebao/src/store/module/ckchat/ckchat.ts b/Touchkebao/src/store/module/ckchat/ckchat.ts index 7b1ee9ef..73e9c2ad 100644 --- a/Touchkebao/src/store/module/ckchat/ckchat.ts +++ b/Touchkebao/src/store/module/ckchat/ckchat.ts @@ -25,7 +25,11 @@ export const useCkChatStore = createPersistStore( kfSelected: 0, //选中的客服 searchKeyword: "", //搜索关键词 isLoadWeChat: false, //是否加载微信 + getIsLoadWeChat: () => { + return useCkChatStore.getState().isLoadWeChat; + }, updateIsLoadWeChat: (isLoadWeChat: boolean) => { + console.log("updateIsLoadWeChat", isLoadWeChat); set({ isLoadWeChat }); }, //客服列表 @@ -549,3 +553,5 @@ export const pinChatSessionToTop = (sessionId: number) => useCkChatStore.getState().getKfSelectedUser(); export const updateIsLoadWeChat = (isLoadWeChat: boolean) => useCkChatStore.getState().updateIsLoadWeChat(isLoadWeChat); +export const getIsLoadWeChat = () => + useCkChatStore.getState().getIsLoadWeChat();