From f2775aef8b4211a79a9c72fbc8d1083e15876474 Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Tue, 8 Sep 2026 00:34:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=94=A8=E6=88=B7=E7=A9=BA=E6=80=81?= =?UTF-8?q?=E6=94=B6=E5=B0=BE:=20babyName=20=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E4=B8=BA=E5=94=AF=E4=B8=80=E4=BA=8B=E5=AE=9E=E6=BA=90(?= =?UTF-8?q?=E6=B8=85=E6=BC=94=E7=A4=BA=E5=90=8D=E5=B0=8F=E6=B1=A4=E5=9C=86?= =?UTF-8?q?);=20data-ga/data-wk/=E5=AD=95=E6=A3=80=E6=97=A5=E5=8E=86?= =?UTF-8?q?=E5=BD=92=E4=B8=AD=E6=80=A7=E5=8D=A0=E4=BD=8D=20(v26090713)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 10 +++++----- js/app.js | 13 +++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 4659ab6..c6ecdf1 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ 妈妈盒子 · 孕育陪伴 - - + + @@ -1758,8 +1758,8 @@ 加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示, 不影响应用其余功能。 --> - - -
v26090712
+ + +
v26090713
diff --git a/js/app.js b/js/app.js index 4efdeb7..a6eb54f 100644 --- a/js/app.js +++ b/js/app.js @@ -1775,6 +1775,13 @@ $('#genWeekTag').textContent = '--'; /* ④ 信件/称呼:新用户无信(后端不播种),列表走 letterEmpty 空提示 */ $('#replyTo').textContent = nm; + /* ⑤ 孕期衍生的静态演示位(生长曲线周数/孕检日历/时光轴日期)一并归中性占位, + 不保留 HTML 里的演示默认值(孕27周/9月15日…) */ + $$('[data-ga]').forEach(n => { n.textContent = '--'; }); + $$('[data-wk]').forEach(n => { n.textContent = '--'; }); + $('#calNext').textContent = '--'; + const _t = new Date(); + $('#noteWhen').textContent = mdTxt(_t); syncBabyWords(); pushLatestToHome(); renderLetters(); @@ -4063,8 +4070,10 @@ const pj = rs[0], pg = rs[1]; if (pj && pj.code === 200 && pj.result) { const p = pj.result; - if (p.babyName) state.babyName = p.babyName; - if (p.userName) state.userName = p.userName; + /* 服务端是唯一事实源:新用户 babyName 为空也要覆盖内置演示名(小汤圆), + 让全站称呼走 babyWord 的「宝宝」兜底 */ + state.babyName = p.babyName || ''; + state.userName = p.userName || ''; if (p.babySex && p.babySex !== 'unknown') state.babySex = p.babySex; if (p.dueDate) { const d = parseDay(p.dueDate); if (d) state.due = d; } /* 状态化「我的」页:未授权→占位+显示授权入口;已授权→资料+隐藏授权入口;已建档(B→C)由孕期信息卡引导 */