新用户空态收尾: babyName 服务端为唯一事实源(清演示名小汤圆); data-ga/data-wk/孕检日历归中性占位 (v26090713)

This commit is contained in:
2026-09-08 00:34:07 +08:00
parent 97f32dfb11
commit f2775aef8b
2 changed files with 16 additions and 7 deletions

View File

@@ -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)由孕期信息卡引导 */