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 = '--'; });