diff --git a/frontend/src/pages/News.jsx b/frontend/src/pages/News.jsx index 0138969..6ad936a 100644 --- a/frontend/src/pages/News.jsx +++ b/frontend/src/pages/News.jsx @@ -487,7 +487,14 @@ export default function News() { {activeTab === 'deal' && (() => { const versions = ['龙钞', '马钞', '蛇钞', '其他'] const packagings = ['标百', '标十', '单张'] - const categories = ['带4号', '带7号', '永恒号', '钻石号', '如意号', '朦胧号', '天马号', '金山号', '金马号'] + const categories = ['带4号', '带7号', '永恒号', '永恒', '钻石号', '钻石', '如意号', '朦胧号', '朦胧王', '天马号', '金山号', '金马号', '天马王', '金山王', '金马王', '倒置号', '圆圆号', '通货', '无4'] + + // 分类名称标准化 + const normalizeCat = (c) => { + if (c === '通货') return '带4号' + if (c === '无4') return '带7号' + return c + } const filteredData = infoList.filter(item => { const serial = (item.title || '').split('-')[0] || '' @@ -502,9 +509,9 @@ export default function News() { const calcAvg = (pkg, cat) => { const items = filteredData.filter(item => { const content = item.content || '' - // 简化正则匹配 const p = content.includes('包装:') ? content.split('包装:')[1].split('\n')[0].trim() : (item.packaging || '') - const c = content.includes('分类:') ? content.split('分类:')[1].split('\n')[0].trim() : (item.category || '') + 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