From a60a54709af0530c5fc5cecf3ac388125b5daf34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B2=E8=BE=B0=E7=94=9F=E4=BA=A7?= Date: Sat, 11 Apr 2026 23:52:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81News=E9=A1=B5=E9=9D=A2type?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/News.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/News.jsx b/frontend/src/pages/News.jsx index 7ef5ca3..aa1a3e1 100644 --- a/frontend/src/pages/News.jsx +++ b/frontend/src/pages/News.jsx @@ -23,7 +23,12 @@ const getStoredUserId = () => { // 资讯页面 - 展示寻配号和行情信息(所有人可见) export default function News() { - const [activeTab, setActiveTab] = useState(localStorage.getItem('news_activeTab') || 'yichen') + // 根据URL参数确定默认tab + const params = new URLSearchParams(window.location.hash.split('?')[1] || '') + const typeParam = params.get('type') + const defaultTab = typeParam === 'seek' ? 'seek' : typeParam === 'deal' ? 'deal' : localStorage.getItem('news_activeTab') || 'yichen' + + const [activeTab, setActiveTab] = useState(defaultTab) const [showSeekPublish, setShowSeekPublish] = useState(false) const [showMySeeks, setShowMySeeks] = useState(false) // 我的寻号 const [showContactId, setShowContactId] = useState(null) // 显示联系方式的寻号ID