From ee04a26ba39ccd79733441e7e673e78fbaa45f98 Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Sun, 20 Sep 2026 02:31:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A6=96=E9=A1=B5):=20=E6=9D=A5=E4=BF=A1?= =?UTF-8?q?=E5=8D=A1=E6=95=B0=E6=8D=AE=E6=BA=90=E6=94=B9=E4=B8=BA=20laixin?= =?UTF-8?q?=EF=BC=8C=E4=B8=8E=E5=BA=95=20tab=20=E7=BA=A2=E7=82=B9=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=EF=BC=88=E4=BF=AE=E4=B8=A4=E5=A5=97=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=EF=BC=89(v26092004)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:底 tab 早已改跳 laixin、红点读 /api/mp/public/laixin/unread,但首页那张 「宝宝来信」卡仍由 pushLatestToHome() 按 LETTERS(box_app /mama-box/letters)驱动, 而那条线对多数用户是 0 封 —— 同一屏上会出现「红点说有新信、卡里什么都没有」。 改法(两者共用一个 laixin 未读结果): - 新增 hideLetterCard() + applyLaixinReminder(r):unread>0 才显示,文案按 「N 封新信 / M 条新回信」组装并附「最近一封 <时间>」;归零收起;上游降级(ok:false)、 访客态、未建档一律收起(与角标同一套判据) - syncLaixinBadge() → syncLaixinReminder():一次 fetch 同时落红点与首页卡(owner 唯一) - 删除 pushLatestToHome() / lettersResolved / state.homeLetter / openDetail(): 内置来信屏(#screen-letter)与其 /letters 数据仍在,但不再往首页推卡 - 首页卡点击改走 openLetterApp()(跳 laixin),与底 tab 同落点;卡不再打开内置详情 - 卡仍默认 .hide + #homeBody 默认 .no-letter(保住 §9 的不闪规则) 验证(本地四态 mock + 浏览器): - laixin 未读=2 → 接口回来前 hidden,回来后显示「小汤圆来信 / 有 1 封新信、1 条新回信 · 最近一封 今天 9:00」,红点同亮(同一次请求) - 未读=0 → 全程收起;上游 ok:false → 冷启动收起、已显示则保持显示 - 访客(无 openid)→ 收起 - **box_app 来信有 1 封未读但 laixin 未读=0 → 首页卡仍收起**(内置屏照常渲染,互不影响) - 点卡 → https://mp.yizhezhe.com/laixin/?openid=…&unionid=…;内置列表点开详情仍正常;errors 空 --- index.html | 31 ++++----- js/app.js | 194 +++++++++++++++++++++-------------------------------- 2 files changed, 94 insertions(+), 131 deletions(-) diff --git a/index.html b/index.html index 862d365..eb98fa5 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + @@ -119,24 +119,25 @@ - -