From 44f778ef1fcb1447d5bd9a96dacd6e8b7cb4b826 Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Tue, 8 Sep 2026 02:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A5=E4=BF=A1hero=E8=AE=A1=E6=95=B0:=20?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E5=96=84=E6=98=BE=E7=A4=BA--=E5=8D=A0?= =?UTF-8?q?=E4=BD=8D/=E5=B7=B2=E5=AE=8C=E5=96=84=E6=8C=89=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E6=95=B0=E9=87=8F;=20=E6=9C=AA=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=97=B6=E9=9A=90=E8=97=8F=E5=86=99=E5=9B=9E=E4=BF=A1FAB?= =?UTF-8?q?=E4=B8=8E=E6=9C=AA=E8=AF=BB=E8=A7=92=E6=A0=87=20(v26090726)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 10 +++++----- js/app.js | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 731326a..31d40f8 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ 妈妈盒子 · 孕育陪伴 - - + + @@ -1771,8 +1771,8 @@ 加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示, 不影响应用其余功能。 --> - - -
v26090725
+ + +
v26090726
diff --git a/js/app.js b/js/app.js index 686e157..4b4e458 100644 --- a/js/app.js +++ b/js/app.js @@ -239,7 +239,7 @@ const cur = $(`#screen-${name}`); if (cur) { cur.scrollTop = 0; updateStatusbar(cur); } // 来信页的写回信按钮 - $('#fabWrite').classList.toggle('show', name === 'letter'); + $('#fabWrite').classList.toggle('show', name === 'letter' && !state.pregEmpty); /* 档案页的孕程已经从圆环换成细条了,这里跟着换成「归零再长回去」。 归零和写目标值必须隔一帧,同一帧里改两次浏览器只会看到最后那个值, transition 无从触发(和 animateRings 里那次强制重绘是一个道理)。 */ @@ -1283,6 +1283,14 @@ const unread = LETTERS.filter(L => L.unread).length; const news = LETTERS.reduce((n, L) => n + L.thread.filter(m => m.isNew).length, 0); state.unread = unread + news; + /* 未完善资料:hero 计数给占位符(没有"共 24 封"这种演示数字),无未读角标 */ + if (state.pregEmpty) { + $('#letterTotal').textContent = '--'; + $('#unreadNum').textContent = '0'; + $('#unreadNum').classList.add('zero'); + $('#tabBadge').classList.remove('show'); + return; + } $('#letterTotal').textContent = LETTER_ARCHIVED + LETTERS.length; $('#unreadNum').textContent = state.unread; /* 全读完了就把红点徽标收起来,别在标签上挂一个孤零零的「0」 */ @@ -1899,6 +1907,8 @@ $('#genWeekTag').textContent = '--'; /* ④ 信件/称呼:新用户无信(后端不播种),列表走 letterEmpty 空提示 */ $('#replyTo').textContent = nm; + /* 未完善 → 「写回信」FAB 隐藏(没有信可回;完善后由 go() 恢复) */ + $('#fabWrite').classList.remove('show'); /* ⑤ 孕期衍生的静态演示位(生长曲线周数/孕检日历/时光轴日期)一并归中性占位, 不保留 HTML 里的演示默认值(孕27周/9月15日…) */ $$('[data-ga]').forEach(n => { n.textContent = '--'; });