-
-
-
-
-
-
- {myList.filter(i => listFilter === 'all' || i.info_type === listFilter).map(item => (
+ {myList.map(item => (
{item.title}
- {item.info_type === 'deal' ? '💰 行情' : '🔍 求购'}
+ {item.info_type === 'deal' ? '💰 成交' : '🔍 求购'}
{item.content &&
{item.content}
}
diff --git a/frontend/src/pages/News.jsx b/frontend/src/pages/News.jsx
index 63ab3eb..a5ff477 100644
--- a/frontend/src/pages/News.jsx
+++ b/frontend/src/pages/News.jsx
@@ -4,7 +4,6 @@ import React, { useState, useEffect } from 'react'
export default function News() {
const [activeTab, setActiveTab] = useState(localStorage.getItem('news_activeTab') || 'seek')
const [showSeekPublish, setShowSeekPublish] = useState(false)
- const [customModal, setCustomModal] = useState({show: false, title: '', content: ''})
const [showMySeeks, setShowMySeeks] = useState(false) // 我的寻号
const [showContactId, setShowContactId] = useState(null) // 显示联系方式的寻号ID
const [showCommentId, setShowCommentId] = useState(null) // 显示评论输入的寻号ID
@@ -118,7 +117,7 @@ export default function News() {
if (data.message === '匹配成功,已通知发布者') {
setMatchedStatus(prev => ({...prev, [infoId]: 'matched'}))
setShowContactId(infoId) // 显示联系方式
- setCustomModal({show: true, title: '匹配成功', content: '已通知发布者,请等待对方联系'})
+ alert('匹配成功!')
fetchInfoList() // 刷新列表
}
} catch (e) {
@@ -131,7 +130,7 @@ export default function News() {
try {
const res = await fetch(`${API_BASE}/api/information/seek/matched-user/${infoId}`, { headers: { Authorization: `Bearer ${token}` } })
const data = await res.json()
- if (data.matched_user_id) setCustomModal({show: true, title: '匹配者信息', content: `用户名: ${data.user_name}\n联系方式: ${data.matched_contact || '未提供'}`})
+ if (data.matched_user_id) alert(`匹配者: ${data.user_name}, 联系方式: ${data.matched_contact || '未提供'}`)
} catch (e) { console.error(e) }
}
const fetchPublisherInfo = async (infoId) => {
@@ -140,7 +139,7 @@ export default function News() {
try {
const res = await fetch(`${API_BASE}/api/information/seek/publisher/${infoId}`, { headers: { Authorization: `Bearer ${token}` } })
const data = await res.json()
- if (data.user_id) setCustomModal({show: true, title: '发布者信息', content: `用户名: ${data.user_name}\n联系方式: ${data.contact || '未提供'}`})
+ if (data.user_id) alert(`发布者: ${data.user_name}, 联系方式: ${data.contact || '未提供'}`)
} catch (e) { console.error(e) }
}
const fetchMatchCollections = async (infoId) => {
@@ -250,7 +249,7 @@ export default function News() {
})
const data = await res.json()
if (data.id || data.code === 0) {
- setCustomModal({show: true, title: '发布成功', content: '您的寻配号信息已发布成功'})
+ alert('发布成功!')
setShowSeekPublish(false)
setSeekForm({ edition: '龙钞', type: '', category: '寻号', price: '', matchType: '模糊', features: '', content: '', title: '', contact: (() => { try { const u = JSON.parse(localStorage.getItem('user') || '{}'); return u.phone || '' } catch { return '' } })() || '' })
fetchInfoList()
@@ -505,7 +504,7 @@ export default function News() {
: 1
}}>
{(item.is_matched === 'matched' || matchedStatus[item.id] === 'matched') ? '已经匹配' : '尚未匹配'}
- {(item.is_matched === 'matched' || matchedStatus[item.id] === 'matched') &&
}
+ {(item.is_matched === 'matched' || matchedStatus[item.id] === 'matched') &&
}
)}
@@ -769,24 +768,6 @@ export default function News() {