支持News页面type参数

This commit is contained in:
甲辰生产 2026-04-11 23:52:36 +08:00
parent b681eebdb1
commit a60a54709a
1 changed files with 6 additions and 1 deletions

View File

@ -23,7 +23,12 @@ const getStoredUserId = () => {
// - // -
export default function News() { export default function News() {
const [activeTab, setActiveTab] = useState(localStorage.getItem('news_activeTab') || 'yichen') // URLtab
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 [showSeekPublish, setShowSeekPublish] = useState(false)
const [showMySeeks, setShowMySeeks] = useState(false) // const [showMySeeks, setShowMySeeks] = useState(false) //
const [showContactId, setShowContactId] = useState(null) // ID const [showContactId, setShowContactId] = useState(null) // ID