jiachenlong/frontend/src/pages/News_original_backup.jsx

32 lines
1.2 KiB
JavaScript

import React, { useState, useEffect } from 'react'
// 资讯页面 - 展示寻配号和行情信息(所有人可见)
export default function News() {
const [activeTab, setActiveTab] = useState('deal')
const [showSeekPublish, setShowSeekPublish] = useState(false)
const [showMySeeks, setShowMySeeks] = useState(false)
const [showMatchList, setShowMatchList] = useState(false)
const [matchCollections, setMatchCollections] = useState([])
const [listFilter, setListFilter] = useState('')
const [currentUserId, setCurrentUserId] = useState('')
const [matchedItems, setMatchedItems] = useState(() => {
try { return JSON.parse(localStorage.getItem('matchedSeekItems') || '{}') } catch { return {} }
})
const [showCommentId, setShowCommentId] = useState(null)
const [commentText, setCommentText] = useState('')
const [comments, setComments] = useState({})
useEffect(() => {
const token = localStorage.getItem('token')
if (token) { try { const payload = JSON.parse(atob(token.split('.')[1])); setCurrentUserId(payload.sub) } catch {} }
}, [])
const API_BASE = 'http://47.103.9.192:3000'
return (
<div>
<h1>News Page TEST</h1>
</div>
)
}