From c32ff2cf29565f1c1c81e74209026721147ab985 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: Tue, 23 Sep 2025 19:15:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B0=8E=E8=88=AA=E7=B5=84=E4=BB=B6?= =?UTF-8?q?=E5=84=AA=E5=8C=96):=20=E7=A7=BB=E9=99=A4NavCommon=E7=B5=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E7=9A=84=E5=86=97=E9=A4=98onMenuClick?= =?UTF-8?q?=E5=B1=AC=E6=80=A7=EF=BC=8C=E4=B8=A6=E5=84=AA=E5=8C=96=E8=8F=9C?= =?UTF-8?q?=E5=96=AE=E5=9C=96=E6=A8=99=E9=BB=9E=E6=93=8A=E9=82=8F=E8=BC=AF?= =?UTF-8?q?=E4=BB=A5=E5=AF=A6=E7=8F=BE=E8=B7=AF=E7=94=B1=E5=88=87=E6=8F=9B?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B6=E9=AB=94=E9=A9=97?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/pc/ckbox/components/NavCommon/index.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx b/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx index d342f07a..114d8cbe 100644 --- a/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx +++ b/Touchkebao/src/pages/pc/ckbox/components/NavCommon/index.tsx @@ -23,10 +23,7 @@ interface NavCommonProps { onMenuClick?: () => void; } -const NavCommon: React.FC = ({ - title = "触客宝", - onMenuClick, -}) => { +const NavCommon: React.FC = ({ title = "触客宝" }) => { const [drawerVisible, setDrawerVisible] = useState(false); const [messageDrawerVisible, setMessageDrawerVisible] = useState(false); const [messageCount] = useState(3); // 模拟消息数量 @@ -34,10 +31,14 @@ const NavCommon: React.FC = ({ const location = useLocation(); const { user, logout } = useUserStore(); - // 处理菜单图标点击 + // 处理菜单图标点击:在两个路由之间切换 const handleMenuClick = () => { - setDrawerVisible(true); - onMenuClick?.(); + const current = location.pathname; + if (current.startsWith("/pc/powerCenter")) { + navigate("/pc/weChat"); + } else { + navigate("/pc/powerCenter"); + } }; // 处理抽屉关闭