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();