From 0054509ef20b9e56194c917e906bf05e9d2fe9d0 Mon Sep 17 00:00:00 2001 From: cc <98377878+hicccc77@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:09:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/services/annualReportService.ts | 22 +++++++++++----------- src/pages/AnnualReportWindow.tsx | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/electron/services/annualReportService.ts b/electron/services/annualReportService.ts index 87a6dc5..4caf50e 100644 --- a/electron/services/annualReportService.ts +++ b/electron/services/annualReportService.ts @@ -960,7 +960,7 @@ class AnnualReportService { // 曾经的好朋友 (Once Best Friend / Lost Friend) let lostFriend: AnnualReportData['lostFriend'] = null - let maxRatio = 5 + let maxEarlyCount = 80 // 最低门槛 let bestEarlyCount = 0 let bestLateCount = 0 let bestSid = '' @@ -991,13 +991,13 @@ class AnnualReportService { const early = (e.sent || 0) + (e.received || 0) const late = (l.sent || 0) + (l.received || 0) if (early > 100 && early > late * 5) { - const ratio = early / (late || 1) - if (ratio > maxRatio) { - maxRatio = ratio + // 选择前期消息量最多的 + if (early > maxEarlyCount) { + maxEarlyCount = early bestEarlyCount = early bestLateCount = late bestSid = sid - bestPeriodDesc = '账号历史早期' + bestPeriodDesc = '这段时间以来' } } } @@ -1023,9 +1023,9 @@ class AnnualReportService { const early = (e.sent || 0) + (e.received || 0) const late = (l.sent || 0) + (l.received || 0) if (early > 80 && early > late * 5) { - const ratio = early / (late || 1) - if (ratio > maxRatio) { - maxRatio = ratio + // 选择前期消息量最多的 + if (early > maxEarlyCount) { + maxEarlyCount = early bestEarlyCount = early bestLateCount = late bestSid = sid @@ -1045,9 +1045,9 @@ class AnnualReportService { for (let m = 7; m <= 12; m++) late += mWeights[m] || 0 if (early > 80 && early > late * 5) { - const ratio = early / (late || 1) - if (ratio > maxRatio) { - maxRatio = ratio + // 选择前期消息量最多的 + if (early > maxEarlyCount) { + maxEarlyCount = early bestEarlyCount = early bestLateCount = late bestSid = sid diff --git a/src/pages/AnnualReportWindow.tsx b/src/pages/AnnualReportWindow.tsx index 0e7db77..afa4765 100644 --- a/src/pages/AnnualReportWindow.tsx +++ b/src/pages/AnnualReportWindow.tsx @@ -355,7 +355,7 @@ function AnnualReportWindow() { } const formatYearLabel = (value: number, withSuffix: boolean = true) => { - if (value === 0) return '全部时间' + if (value === 0) return '历史以来' return withSuffix ? `${value}年` : `${value}` } @@ -769,8 +769,8 @@ function AnnualReportWindow() { const socialStoryName = topFriend?.displayName || '好友' const yearTitle = formatYearLabel(year, true) const yearTitleShort = formatYearLabel(year, false) - const monthlyTitle = year === 0 ? '全部时间月度好友' : `${year}年月度好友` - const phrasesTitle = year === 0 ? '你在全部时间的常用语' : `你在${year}年的年度常用语` + const monthlyTitle = year === 0 ? '历史以来月度好友' : `${year}年月度好友` + const phrasesTitle = year === 0 ? '你在历史以来的常用语' : `你在${year}年的年度常用语` return (