支持News页面type参数
This commit is contained in:
parent
b681eebdb1
commit
a60a54709a
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue