diff --git a/config/VERSION b/config/VERSION index 344ef87..8ee6c12 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -VERSION=v0.0.7 +VERSION=v0.1.8 diff --git a/frontend/src/pages/News.jsx b/frontend/src/pages/News.jsx index 8a52141..709823e 100644 --- a/frontend/src/pages/News.jsx +++ b/frontend/src/pages/News.jsx @@ -1,7 +1,8 @@ /** * News - 资讯列表页面 - * Version: 0.0.8 (2026-04-24) + * Version: 0.0.9 (2026-05-01) * 稳定版:自有匹配+网络匹配缓存 + * 更新:成交行情页面新增筛选功能(版别、包装类型、号码分类) */ import React, { useState, useEffect } from 'react' @@ -39,6 +40,8 @@ export default function News() { const [matchedStatus, setMatchedStatus] = useState({}) // 存储各寻号的匹配状态 const [showMatchList, setShowMatchList] = useState(false) const [dealVersion, setDealVersion] = useState('龙钞') + const [dealPackagingFilter, setDealPackagingFilter] = useState('') // 包装类型筛选 + const [dealNumberCatFilter, setDealNumberCatFilter] = useState('') // 号码分类筛选 const [dealDate, setDealDate] = useState('') const [dealDetailItems, setDealDetailItems] = useState(null) // 弹窗显示的详情列表 const [matchCollections, setMatchCollections] = useState([]) @@ -558,6 +561,22 @@ export default function News() { else if (serial.startsWith('J1')) version = '马钞' else if (serial.startsWith('J3')) version = '蛇钞' if (version !== dealVersion) return false + + // 包装类型筛选 + if (dealPackagingFilter) { + const content = item.content || '' + const p = content.includes('包装:') ? content.split('包装:')[1].split('\n')[0].trim() : (item.packaging || '') + if (p !== dealPackagingFilter) return false + } + + // 号码分类筛选 + if (dealNumberCatFilter) { + const content = item.content || '' + let c = content.includes('分类:') ? content.split('分类:')[1].split('\n')[0].trim() : (item.category || '') + c = normalizeCat(c) + if (c !== dealNumberCatFilter) return false + } + return true }) @@ -577,6 +596,8 @@ export default function News() { return (
+ {/* 版别筛选 */} +
版别筛选:
{versions.map(v => ( ))}
+ + {/* 包装类型筛选 */} +
包装筛选:
+
+ {[{value: '', label: '全部'}, ...packagings.map(p => ({value: p, label: p}))].map(item => ( + + ))} +
+ + {/* 号码分类筛选 */} +
号码分类:
+
+ {[ + {value: '', label: '全部'}, + {value: '带4号', label: '带4号'}, + {value: '带7号', label: '带7号'}, + {value: '永恒号', label: '永恒'}, + {value: '钻石号', label: '钻石'}, + {value: '天马号', label: '天马'}, + {value: '金山号', label: '金山'}, + {value: '金马号', label: '金马'}, + {value: '倒置号', label: '倒置'}, + {value: '圆圆号', label: '圆圆'} + ].map(item => ( + + ))} +
+ + {/* 清除筛选 */} + {(dealPackagingFilter || dealNumberCatFilter) && ( + + )}
@@ -696,7 +763,42 @@ export default function News() {
)} - {infoList.map(item => { + {infoList.filter(item => { + // 成交行情 tab - 应用筛选 + if (activeTab === 'deal') { + const content = item.content || '' + const serial = (item.title || '').split('-')[0] || '' + + // 版别筛选 + let version = '其他' + if (serial.startsWith('J0')) version = '龙钞' + else if (serial.startsWith('J1')) version = '马钞' + else if (serial.startsWith('J3')) version = '蛇钞' + if (version !== dealVersion) return false + + // 包装类型筛选 + const packagingMatch = content.match(/包装:\s*(.+?)(?:\n|$)/) + const packaging = packagingMatch ? packagingMatch[1].trim() : (item.packaging || '') + if (dealPackagingFilter && packaging !== dealPackagingFilter) return false + + // 号码分类筛选 + const categoryMatch = content.match(/分类:\s*(.+?)(?:\n|$)/) + let category = categoryMatch ? categoryMatch[1].trim() : (item.category || '') + // 标准化分类名 + if (category === '通货' || category === '无4') category = '带4号' + if (category === '永恒') category = '永恒号' + if (category === '钻石') category = '钻石号' + if (category === '天马' || category === '天马号') category = '天马号' + if (category === '金山' || category === '金山号') category = '金山号' + if (category === '金马' || category === '金马号') category = '金马号' + if (category === '倒置') category = '倒置号' + if (category === '圆圆') category = '圆圆号' + if (dealNumberCatFilter && category !== dealNumberCatFilter) return false + + return true + } + return true + }).map(item => { // 成交行情 tab - 按维度汇总展示 if (activeTab === 'deal') { const content = item.content || ''