Compare commits

...

7 Commits

Author SHA1 Message Date
甲辰生产 4e30a39377 v1.2.86 首页成交行情显示版 2026-04-11 22:57:52 +08:00
甲辰生产 8ff8a31b2b 恢复条件判断 2026-04-11 22:57:27 +08:00
甲辰生产 c02fdf8269 强制显示成交统计 2026-04-11 22:56:13 +08:00
甲辰生产 407d05e3fd 添加平均成交价表头 2026-04-11 22:54:40 +08:00
甲辰生产 6c1e927f42 强制显示今日成交统计卡片 2026-04-11 22:53:26 +08:00
甲辰生产 c813e82232 首页添加今日成交数据统计卡片 2026-04-11 22:47:47 +08:00
甲辰生产 c7e8052194 v1.2.85 全量版本:成交行情页面优化、日期筛选、分类排序、展示格式调整 2026-04-11 22:41:56 +08:00
5 changed files with 153 additions and 3 deletions

View File

@ -1 +1 @@
VERSION=1.2.79 1.2.85

View File

@ -1 +1 @@
VERSION=1.2.81 1.2.85

View File

@ -1,6 +1,6 @@
{ {
"name": "jiachenlong-frontend", "name": "jiachenlong-frontend",
"version": "1.2.82", "version": "1.2.86",
"private": true, "private": true,
"description": "甲辰藏品管理系统 - 移动端前端", "description": "甲辰藏品管理系统 - 移动端前端",
"scripts": { "scripts": {

View File

@ -9,8 +9,47 @@ export default function Home() {
const [seekStats, setSeekStats] = useState({ seekCount: 0, matchedCount: 0 }) const [seekStats, setSeekStats] = useState({ seekCount: 0, matchedCount: 0 })
const [recentPosts, setRecentPosts] = useState([]) const [recentPosts, setRecentPosts] = useState([])
const [dragonStats, setDragonStats] = useState({}) const [dragonStats, setDragonStats] = useState({})
const [dealStats, setDealStats] = useState({ total: 0, items: [] })
const [dealVersion, setDealVersion] = useState('龙钞')
const [dealDetailItems, setDealDetailItems] = useState(null)
const currentPath = window.location.hash.slice(1) || '/' const currentPath = window.location.hash.slice(1) || '/'
//
const categoryOrder = ['带4号', '带7号', '永恒号', '天马号', '天马王', '金山号', '金山王', '钻石号', '朦胧号', '朦胧王', '金马号', '金马王', '倒置号', '圆圆号']
const normalizeCat = (c) => {
if (c === '通货') return '带4号'
if (c === '无4') return '带7号'
return c
}
const calcDealAvg = (pkg, cat) => {
const items = dealStats.items.filter(item => {
const content = item.content || ''
const p = content.includes('包装:') ? content.split('包装:')[1].split('\n')[0].trim() : (item.packaging || '')
let c = content.includes('分类:') ? content.split('分类:')[1].split('\n')[0].trim() : (item.category || '')
c = normalizeCat(c)
return p === pkg && c === cat
})
if (items.length === 0) return null
const sum = items.reduce((a, b) => a + (b.deal_price || 0), 0)
return { avg: Math.round(sum / items.length), count: items.length, items }
}
//
useEffect(() => {
const today = new Date()
const dealDate = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
fetch(`/api/information/list?info_type=deal&deal_date=${dealDate}&page_size=500`)
.then(res => res.json())
.then(data => {
if (Array.isArray(data)) {
setDealStats({ total: data.length, items: data })
}
})
.catch(() => {})
}, [])
useEffect(() => { useEffect(() => {
const token = localStorage.getItem('token') const token = localStorage.getItem('token')
const userData = localStorage.getItem('user') const userData = localStorage.getItem('user')
@ -232,6 +271,64 @@ export default function Home() {
</div> </div>
</div> </div>
{/* 今日成交数据统计 */}
{dealStats.total > 0 && (
<div style={{ marginBottom: '20px' }}>
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>📈 今日成交数据统计</div>
<div style={{ background: '#1e293b', borderRadius: '12px', padding: '16px' }}>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', marginBottom: '12px' }}>
{['龙钞', '马钞', '蛇钞', '其他'].map(v => (
<button key={v} onClick={() => setDealVersion(v)}
style={{ padding: '6px 16px', borderRadius: '8px', border: 'none', cursor: 'pointer',
background: dealVersion === v ? '#3b82f6' : 'rgba(255,255,255,0.1)',
color: '#fff', fontSize: '13px', fontWeight: dealVersion === v ? '600' : '400' }}>
{v}
</button>
))}
</div>
<div style={{ overflowX: 'auto' }}>
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '13px' }}>
<thead>
<tr>
<th style={{ padding: '8px', textAlign: 'left', color: '#94a3b8', borderBottom: '1px solid rgba(255,255,255,0.1)' }}></th>
<th colSpan={3} style={{ padding: '8px', textAlign: 'center', color: '#22c55e', borderBottom: '1px solid rgba(255,255,255,0.1)', fontSize: '14px' }}>平均成交价</th>
</tr>
<tr>
<th style={{ padding: '8px', textAlign: 'left', color: '#94a3b8', borderBottom: '1px solid rgba(255,255,255,0.1)' }}></th>
{['标百', '标十', '单张'].map(p => (
<th key={p} style={{ padding: '8px', textAlign: 'center', color: '#94a3b8', borderBottom: '1px solid rgba(255,255,255,0.1)' }}>{p}</th>
))}
</tr>
</thead>
<tbody>
{categoryOrder.map(cat => {
const rowData = ['标百', '标十', '单张'].map(pkg => calcDealAvg(pkg, cat))
const hasData = rowData.some(d => d !== null)
if (!hasData) return null
return (
<tr key={cat}>
<td style={{ padding: '8px', color: '#fbbf24', fontWeight: '500', borderBottom: '1px solid rgba(255,255,255,0.05)' }}>{cat}</td>
{rowData.map((d, i) => (
<td key={i} style={{ padding: '8px', textAlign: 'center', borderBottom: '1px solid rgba(255,255,255,0.05)' }}>
{d ? (
<div style={{ color: '#22c55e', fontWeight: '600', cursor: 'pointer' }}
onClick={() => setDealDetailItems(d.items)}>
¥{d.avg.toLocaleString()}
<span style={{ color: '#64748b', fontSize: '11px', marginLeft: '4px' }}>({d.count})</span>
</div>
) : <span style={{ color: '#475569' }}>-</span>}
</td>
))}
</tr>
)
})}
</tbody>
</table>
</div>
</div>
</div>
)}
{/* 一尘今日数据 */} {/* 一尘今日数据 */}
<div style={{ marginBottom: '20px' }}> <div style={{ marginBottom: '20px' }}>
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>📊 一尘今日连体纪念钞数据</div> <div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>📊 一尘今日连体纪念钞数据</div>
@ -389,6 +486,55 @@ export default function Home() {
))} ))}
</div> </div>
<div style={{ height: '70px' }}></div> <div style={{ height: '70px' }}></div>
{/* 成交详情弹窗 */}
{dealDetailItems && (
<div style={{
position: 'fixed', top: 0, left: 0, right: 0, bottom: 0,
background: 'rgba(0,0,0,0.8)', display: 'flex', alignItems: 'center', justifyContent: 'center',
zIndex: 1000, padding: '20px'
}} onClick={() => setDealDetailItems(null)}>
<div style={{
background: '#1e293b', borderRadius: '12px', padding: '20px', maxWidth: '600px', width: '100%', maxHeight: '80vh', overflow: 'auto'
}} onClick={e => e.stopPropagation()}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '16px' }}>
<div style={{ color: '#fff', fontSize: '16px', fontWeight: '600' }}>成交详情列表</div>
<button onClick={() => setDealDetailItems(null)}
style={{ background: 'none', border: 'none', color: '#94a3b8', fontSize: '20px', cursor: 'pointer' }}></button>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
{([...dealDetailItems].sort((a, b) => (a.deal_price || 0) - (b.deal_price || 0))).map((item, idx) => {
const content = item.content || ''
const grade = content.includes('评级:') ? content.split('评级:')[1].split('\n')[0].trim() : (item.grading_score || '')
const sizeMatch = content.match(/大小号:\s*(.+?)(?:\n|$)/)
const size = sizeMatch ? sizeMatch[1].trim() : ''
const platformMatch = content.match(/平台:\s*(.+?)(?:\n|$)/)
const platform = platformMatch ? platformMatch[1].trim() : '-'
return (
<div key={idx} style={{
background: 'rgba(255,255,255,0.05)', borderRadius: '8px', padding: '12px',
display: 'flex', justifyContent: 'space-between', alignItems: 'center'
}}>
<div>
<div style={{ color: '#fbbf24', fontWeight: '600', marginBottom: '4px' }}>
{(item.title || '').split('-')[0]}
{size && <span style={{ color: '#94a3b8', marginLeft: '8px' }}>| {size}</span>}
{grade && <span style={{ color: '#06b6d4', marginLeft: '8px' }}>| {grade}</span>}
</div>
<div style={{ color: '#94a3b8', fontSize: '12px' }}>
{item.deal_date} | {item.category} | {item.packaging} | {platform}
</div>
</div>
<div style={{ color: '#22c55e', fontSize: '18px', fontWeight: '700' }}>
¥{item.deal_price?.toLocaleString()}
</div>
</div>
)
})}
</div>
</div>
</div>
)}
</div> </div>
) )
} }

View File

@ -577,6 +577,10 @@ export default function News() {
<div style={{ overflowX: 'auto' }}> <div style={{ overflowX: 'auto' }}>
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '13px' }}> <table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '13px' }}>
<thead> <thead>
<tr>
<th style={{ padding: '8px', textAlign: 'left', color: '#94a3b8', borderBottom: '1px solid rgba(255,255,255,0.1)' }}></th>
<th colSpan={3} style={{ padding: '8px', textAlign: 'center', color: '#22c55e', borderBottom: '1px solid rgba(255,255,255,0.1)', fontSize: '14px' }}>平均成交价</th>
</tr>
<tr> <tr>
<th style={{ padding: '8px', textAlign: 'left', color: '#94a3b8', borderBottom: '1px solid rgba(255,255,255,0.1)' }}></th> <th style={{ padding: '8px', textAlign: 'left', color: '#94a3b8', borderBottom: '1px solid rgba(255,255,255,0.1)' }}></th>
{packagings.map(p => ( {packagings.map(p => (