diff --git a/Cunkebao/src/pages/mobile/mine/main/index.tsx b/Cunkebao/src/pages/mobile/mine/main/index.tsx index 45358e3f..66450792 100644 --- a/Cunkebao/src/pages/mobile/mine/main/index.tsx +++ b/Cunkebao/src/pages/mobile/mine/main/index.tsx @@ -90,7 +90,7 @@ const Mine: React.FC = () => { description: "触客宝", icon: , count: 0, - path: "/mine/ckbox", + path: "/ckbox/weChat", bgColor: "#fff7e6", iconColor: "#fa8c16", }, diff --git a/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.data.ts b/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.data.ts new file mode 100644 index 00000000..f42e11af --- /dev/null +++ b/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.data.ts @@ -0,0 +1,44 @@ +// 菜单项接口 +export interface MenuItem { + id: string; + title: string; + icon: string; + path?: string; +} + +// 菜单列表数据 +export const menuList: MenuItem[] = [ + { + id: "dashboard", + title: "数据面板", + icon: "📊", + path: "/ckbox/dashboard", + }, + { + id: "wechat", + title: "微信管理", + icon: "💬", + path: "/ckbox/weChat", + }, +]; + +// 抽屉菜单配置数据 +export const drawerMenuData = { + header: { + logoIcon: "✨", + appName: "触客宝", + appDesc: "AI智能营销系统", + }, + primaryButton: { + title: "AI智能客服", + icon: "🔒", + }, + footer: { + balanceIcon: "⚡", + balanceLabel: "算力余额", + balanceValue: "9307.423", + }, +}; + +// 导出默认配置 +export default drawerMenuData; diff --git a/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx index c8892960..500099fa 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx @@ -9,6 +9,7 @@ import { import type { MenuProps } from "antd"; import { useCkChatStore } from "@/store/module/ckchat/ckchat"; import { useNavigate } from "react-router-dom"; +import { drawerMenuData, menuList } from "./index.data"; import styles from "./index.module.scss"; const { Header } = Layout; @@ -16,16 +17,14 @@ const { Header } = Layout; interface NavCommonProps { title?: string; onMenuClick?: () => void; - drawerContent?: React.ReactNode; } const NavCommon: React.FC = ({ title = "触客宝", onMenuClick, - drawerContent, }) => { const [drawerVisible, setDrawerVisible] = useState(false); - + const navigate = useNavigate(); const { userInfo } = useCkChatStore(); // 处理菜单图标点击 @@ -44,31 +43,55 @@ const NavCommon: React.FC = ({
-
+
+ {drawerMenuData.header.logoIcon} +
-
触客宝
-
AI智能营销系统
+
+ {drawerMenuData.header.appName} +
+
+ {drawerMenuData.header.appDesc} +
-
🔒
- AI智能客服 +
+ {drawerMenuData.primaryButton.icon} +
+ {drawerMenuData.primaryButton.title}
-
-
📊
- 功能中心 -
+ {menuList.map((item, index) => ( +
{ + if (item.path) { + navigate(item.path); + setDrawerVisible(false); + } + }} + > +
{item.icon}
+ {item.title} +
+ ))}
- 算力余额 + + {drawerMenuData.footer.balanceIcon} + + {drawerMenuData.footer.balanceLabel} +
+
+ {drawerMenuData.footer.balanceValue}
-
9307.423
@@ -111,7 +134,7 @@ const NavCommon: React.FC = ({ width={300} className={styles.drawer} > - {drawerContent || defaultDrawerContent} + {defaultDrawerContent} ); diff --git a/Cunkebao/src/pages/pc/ckbox/weChat/index.tsx b/Cunkebao/src/pages/pc/ckbox/weChat/index.tsx index 2129769c..2c6a8db6 100644 --- a/Cunkebao/src/pages/pc/ckbox/weChat/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/weChat/index.tsx @@ -1,12 +1,10 @@ import React, { useState, useEffect } from "react"; -import { Layout, Button, Space, message, Tooltip } from "antd"; -import { InfoCircleOutlined, MessageOutlined } from "@ant-design/icons"; -import dayjs from "dayjs"; +import { Layout } from "antd"; +import { MessageOutlined } from "@ant-design/icons"; import ChatWindow from "./components/ChatWindow/index"; import SidebarMenu from "./components/SidebarMenu/index"; import VerticalUserList from "./components/VerticalUserList"; import PageSkeleton from "./components/Skeleton"; -import NavCommon from "./components/NavCommon"; import styles from "./index.module.scss"; import { addChatSession } from "@/store/module/ckchat/ckchat"; const { Content, Sider } = Layout; @@ -54,7 +52,6 @@ const CkboxPage: React.FC = () => { return ( - {/* 垂直侧边栏 */} diff --git a/Cunkebao/src/router/module/ckbox.tsx b/Cunkebao/src/router/module/ckbox.tsx index 4ca69087..1fbb8b61 100644 --- a/Cunkebao/src/router/module/ckbox.tsx +++ b/Cunkebao/src/router/module/ckbox.tsx @@ -1,30 +1,27 @@ -import type { RouteObject } from "react-router-dom"; import CkboxPage from "@/pages/pc/ckbox"; import WeChatPage from "@/pages/pc/ckbox/weChat"; import Dashboard from "@/pages/pc/ckbox/dashboard"; -const ckboxRoutes: (RouteObject & { auth?: boolean; requiredRole?: string })[] = - [ - { - path: "/ckbox", - element: , - auth: true, - requiredRole: "user", - children: [ - { - path: "", - element: , - }, - { - path: "dashboard", - element: , - }, - { - path: "weChat", - element: , - }, - ], - }, - ]; +const ckboxRoutes = [ + { + path: "/ckbox", + element: , + auth: true, + children: [ + { + path: "", + element: , + }, + { + path: "dashboard", + element: , + }, + { + path: "weChat", + element: , + }, + ], + }, +]; export default ckboxRoutes;