diff --git a/index.html b/index.html index 78bfad9..ca4a4ab 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + diff --git a/js/app.js b/js/app.js index c3153b9..34d8155 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26092215'; + var VER = '26092216'; const $ = (s, c) => (c || document).querySelector(s); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); @@ -3112,8 +3112,10 @@ hide 有档案但**接口读不到**(网络 / 非 200 / 上游故障且无旧值)→ **整块不显示** ⚠️ 原来「读不到」是回退到 4 条**写死的演示行**(胎动 12 次 / 体重 58.2kg…)—— 上游一抖页面就开始编数据。那 4 行已从 index.html 删掉,换成一行为中性「正在获取…」。 - ⚠️ 除 rows 外一律给 .today-line 挂 .no-ai:AI 气泡里的次数是写死的演示文案, - 没有真实事件时显示它等于说假话(见 index.html 里那段注释与待办)。 */ + ⚠️ 除「已建档 + rows」外一律给 .today-line 挂 .no-ai:AI 气泡里的次数是写死的演示文案, + 没有真实事件(或还没建档)时显示它等于说假话(见 index.html 里那段注释与待办)。 + ⚠️ **未建档(pregEmpty)不再整块隐藏**:照接口结论显示(无档案→引导), + 所以新用户首页也能看到「去「数胎动」记一笔」的引导。 */ /* 当前模式 + 事件缓存在这里 —— fpRender() 是**模块显隐的唯一 owner**。 ⚠️ 之前 syncPregnancy 也直接改 .today-line 的 display,两个 owner 会撞竞态: 接口先判「不显示」(hide),profile 后回来又把模块显示回来 → degraded 场景就是这么漏出来的。 */ @@ -3123,12 +3125,16 @@ function fpRender() { const tl = document.querySelector('.today-line'), steps = $('#tlSteps'), guide = $('#tlGuide'); if (!tl || !steps) return; - /* 未建档 / 产后:整块不给(不看接口怎么回)——这是硬门槛,优先于接口结论 */ - const mode = (state.pregEmpty || state.postpartum) ? 'hide' : _fpMode; + /* ⚠️ **未建档不再整块隐藏**(2026-09-22 产品口径):模块照接口给的结论显示 —— + 无档案→引导、有档案→事件/空态、读不到→不显示。原来那道 pregEmpty/postpartum 硬门槛已去掉。 */ + const mode = _fpMode; if (mode === 'hide') { tl.style.display = 'none'; return; } tl.style.display = ''; - /* 只有拿到真实事件才显示 AI 气泡(见 index.html 那段注释与待办) */ - tl.classList.toggle('no-ai', mode !== 'rows'); + /* ⚠️ AI 气泡里的次数是**写死的演示文案**,所以只有「已建档 + 拿到真实事件」才显示它: + 未建档(还没孕产期,页面本来就全是占位)/ 今天没记 / 无档案 / 读不到 都不显示, + 否则同一屏上会出现「还没有足迹」与「动了 3 次」并存这种自相矛盾。 + (数字接真实次数是另一件事,等产品定文案,见 index.html 那段注释与待办。) */ + tl.classList.toggle('no-ai', mode !== 'rows' || state.pregEmpty); if (guide) guide.style.display = (mode === 'guide') ? '' : 'none'; if (mode === 'guide') { steps.style.display = 'none'; steps.innerHTML = ''; return; } steps.style.display = ''; @@ -3162,7 +3168,7 @@ .then(j => { const r = (j && j.code === 200 && j.result) ? j.result : null; if (!r) { fpApply('hide'); return; } // 读不到 → 不显示(不再编数据) - if (state.pregEmpty) { fpApply('hide'); return; } // 未建档:本模块不给(原有口径) + /* 未建档不再拦(2026-09-22 产品口径):照接口结论走,未建档也能看到引导占位 */ if (!r.linked) { fpApply('guide'); return; } // 无档案 → 引导占位 if (r.degraded) { fpApply('hide'); return; } // 有档案、上游故障且无旧值 → 不显示 const events = (r.events || []).slice(-8); // 升序取最近 8 条