From dced540eb8ee3b4584bbe2e680099740406cd063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B2=E8=BE=B0=E7=94=9F=E4=BA=A7?= Date: Sat, 11 Apr 2026 21:11:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=B1=BB=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/News.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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