今日脚印:无记录时改为「今日待办」清单;宝宝今天想说去掉 AI 角标

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 01:23:09 +00:00
parent 39c27e4bf2
commit fcac03ea59
3 changed files with 77 additions and 52 deletions

View File

@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title>
<!-- V:26100153 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<!-- V:26100154 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css">
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->
@@ -399,18 +399,19 @@
</div>
<button class="fp-all" data-goto="archive">全部<i>›</i></button>
</div>
<p class="fp-demo-t" id="fpDemoT" style="display:none"><i>✦</i>记上一笔,这里就会长成这样</p>
<div class="steps fp-steps ripple" id="tlSteps" data-goto="archive" role="button" tabindex="0" aria-label="宝宝的今日脚印,查看完整档案">
<div class="step"><span class="st-time">今天</span><span class="st-dot"></span><span class="st-txt">正在获取今天的脚印…</span><span class="st-from"></span></div>
</div>
<div class="tl-guide fp-guide" id="tlGuide" style="display:none">
<span class="fg-walk" aria-hidden="true"><i class="fw0"><svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg></i><i class="fw1"><svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg></i><i class="fw2"><svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg></i><i class="fw3"><svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg></i><i class="fw4"><svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg></i></span>
<span class="tl-guide-t" id="tlGuideTitle">还没有你的脚印</span>
<span class="tl-guide-s" id="tlGuideSub">去上面的工具记一笔,这里就会长出你今天的脚印</span>
<span class="tl-guide-apps" id="tlGuideApps"></span>
<!-- 2026-10-02 用户要求:今天还没用任何工具时,不再放示例/引导语,改成「今日待办」清单,提醒她今天该做什么。
条目 = 接口 unused(今天还没用的、已上架的应用),文案由 app.js FP_TODO 按应用名配成一句动作。 -->
<div class="tl-guide fp-guide fp-todo" id="tlGuide" style="display:none">
<div class="td-head"><b>今日待办</b><span class="td-cnt" id="tdCnt"></span></div>
<p class="tl-guide-t td-lead" id="tlGuideTitle"></p>
<div class="tl-guide-apps td-list" id="tlGuideApps"></div>
<p class="tl-guide-s td-foot" id="tlGuideSub"></p>
</div>
<button class="ai-bubble fp-note ripple" data-open="detailAI">
<span class="fn-top"><span class="ab-badge">AI</span><b class="ab-tag" id="abTag">宝宝今天想说</b></span>
<span class="fn-top"><b class="ab-tag" id="abTag">宝宝今天想说</b></span>
<span class="ab-say"></span>
<span class="fn-foot"><span class="fn-sign" id="fpSign">—— 宝宝</span><em>往期小结 ›</em></span>
</button>

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100153';
var VER = '26100154';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -1371,10 +1371,8 @@
「今日成长脚印」→「小汤圆的今日脚印」
这三处原来是写死的功能名。换成小名不只是亲切 —— 数胎动、称体重这些事,
妈妈是在替谁做,标题里就该有谁。
⚠️ AI 气泡上那枚 .ab-badge「AI」必须留着。
标题可以换成宝宝的口吻,但「这段话是机器生成的」不能因此说不清楚。
气泡页脚原来还有一句「AI自动汇总你每日记录」,第五批按用户要求删了 ——
于是这枚角标现在是**唯一**的机器生成提示,别再动它。测试里钉了一条。 */
⚠️ 气泡上原来那枚 .ab-badge「AI」角标,2026-10-02 用户明确要求去掉(首页便签不再标 AI)。
详情页 #detailAI 的说明仍在;以后要恢复机器生成提示,回 index.html 的 .fn-top 里加回来。 */
$('#dockTitle').textContent = babyWord('的孕育工具');
$('#abTag').textContent = babyWord('今天想说');
$('#tlTitle').textContent = babyWord('的今日脚印');
@@ -1663,7 +1661,7 @@
两条边界,别越过去:
· 口吻变软了,但不吓人那条铁律照旧 —— 不提异常、不提风险、不提就医。
· 只有宝宝在说的话改口吻。页尾免责声明、气泡上那枚 .ab-badge「AI」
· 只有宝宝在说的话改口吻。页尾免责声明(以及 2026-10-02 前气泡上的「AI」角标,已按用户要求去掉)
是系统在说话,保持原样,否则就成了宝宝自己声明自己不是医生。
(气泡落款那句「AI自动汇总你每日记录」第五批按用户要求删了,
机器生成的提示现在只剩那枚角标。)
@@ -4056,17 +4054,8 @@
tl.classList.toggle('no-ai', !txt);
tl.classList.toggle('ai-warn', !!(r.digest && r.digest.warn));
if (guide) guide.style.display = (mode === 'guide') ? '' : 'none';
/* 2026-10-01 用户要求:还没脚印时先给两条「用过之后长这样」的示例。
⚠️ 这是**明确标注的示例**(上方提示语 + 每张卡的「示例」角标 + 整体变淡),不是冒充真实记录;
别把它挪到 rows 分支里,也别去掉标注。 */
const demoT = $('#fpDemoT');
if (demoT) demoT.style.display = (mode === 'guide') ? '' : 'none';
steps.classList.toggle('is-demo', mode === 'guide');
if (mode === 'guide') {
steps.style.display = ''; steps.innerHTML = '';
FP_DEMO.forEach(row => { const el = buildFootprintStep(row); el.querySelector('.st-card').insertAdjacentHTML('beforeend', '<i class="st-demo">示例</i>'); steps.append(el); });
renderGuide(r); return;
}
/* 2026-10-02 用户要求:没脚印时改成「今日待办」清单(见 renderGuide),不再放示例行。 */
if (mode === 'guide') { steps.style.display = 'none'; steps.innerHTML = ''; renderGuide(r); return; }
steps.style.display = '';
steps.innerHTML = '';
if (mode === 'pending') { steps.append(pendingFootprintStep()); return; }
@@ -4091,39 +4080,57 @@
/* 引导占位:文案与应用都来自上游 —— lead 是上游自己的引导语,unused[] 是今天没用过的应用。
能对上 App 表的(identifier 由 box_app 按 url 路径解析)渲染成可点芯片,其余只显示名字。 */
/* 今日待办:每个还没用的工具配一句「今天该做的事」。按应用名关键词匹配,匹配不上就用通用句。 */
const FP_TODO = [
[/胎动/, '数一次胎动', '安静侧躺 1 小时,看看小家伙动了几次'],
[/宫缩/, '留意一下宫缩', '肚子发紧时记下间隔和持续时间'],
[/体重/, '称一下今天的体重', '早上空腹称最准,看看本周涨了多少'],
[/血糖/, '记一次血糖', '餐后 2 小时测一次,记下来给医生看'],
[/血压/, '量一次血压', '坐着休息 5 分钟后再量'],
[/补水|补剂|喝水/, '喝水和补剂打个卡', '今天的叶酸、钙片、水喝够了吗'],
[/待产/, '看看待产包还差什么', '一次备一点,临产不手忙脚乱'],
[/产检|孕检|日历/, '确认下次产检时间', '提前看看要空腹还是要憋尿'],
[/能不能吃/, '查查今天想吃的能不能吃', '馋什么先查一下,吃得放心'],
[/能不能做/, '查查今天想做的能不能做', '染发、泡澡、运动……先查再做'],
[/估重/, '算一算宝宝有多重', '拿最近一次 B 超数据就能估'],
[/起名/, '给宝宝想一个名字', '挑几个喜欢的字,和家人一起选'],
[/档案/, '翻翻孕期档案', '把这周的变化记进档案里'],
];
function todoLine(name) {
for (const [re, t, d] of FP_TODO) if (re.test(name)) return [t, d];
return ['用一下「' + name + '」', '花一分钟,给今天留个记录'];
}
function renderGuide(r) {
const title = $('#tlGuideTitle'), sub = $('#tlGuideSub'), box = $('#tlGuideApps');
if (title) title.textContent = (r && r.lead) || '还没有你的脚印';
const title = $('#tlGuideTitle'), sub = $('#tlGuideSub'), box = $('#tlGuideApps'), cnt = $('#tdCnt');
if (title) title.textContent = (r && r.lead) || '';
if (title) title.style.display = (r && r.lead) ? '' : 'none';
if (!box) return;
box.innerHTML = '';
((r && r.unused) || []).slice(0, 5).forEach(u => {
((r && r.unused) || []).slice(0, 4).forEach(u => {
const ident = u.identifier || '';
const app = ident ? APP_BY_ID[ident] : null;
/* ⚠️ 优先用上游带回的 `url`(2026-09-23 起它只推**我们已上架**的应用并把正式 url 带回来,
接口方原话「有 url 就直接跳,不用再对 App 表」);App 表只作兜底。
identifier 仍用于 jumpApp 的 last_app 上报(服务端会校验 url 对得上在架应用)。 */
const href = u.url || (app && app.url) || '';
if (href) {
const b = document.createElement('button');
b.type = 'button';
b.className = 'tl-chip ripple';
const logo = (app && (app.logo || app.icon)) || '';
if (logo) { const im = document.createElement('img'); im.src = logo; im.alt = ''; im.loading = 'lazy'; b.appendChild(im); }
b.append(u.appName || (app && app.name) || ident);
b.addEventListener('click', () => jumpApp(href, (app && app.identifier) || ident || ''));
box.appendChild(b);
} else if (u.appName) {
const sp = document.createElement('span');
sp.className = 'tl-chip is-plain';
sp.textContent = u.appName;
box.appendChild(sp);
}
const name = u.appName || (app && app.name) || ident;
if (!name) return;
const [t, d] = todoLine(name);
const row = document.createElement(href ? 'button' : 'div');
row.className = 'td-row' + (href ? ' ripple' : '');
if (href) row.type = 'button';
const logo = (app && (app.logo || app.icon)) || '';
row.innerHTML = '<i class="td-box" aria-hidden="true"></i><span class="td-txt"><b></b><em></em></span>' +
(logo ? '<img class="td-ico" alt="" loading="lazy">' : '') + (href ? '<span class="td-go">去完成</span>' : '');
row.querySelector('b').textContent = t;
row.querySelector('em').textContent = d;
if (logo) row.querySelector('img').src = logo;
if (href) row.addEventListener('click', () => jumpApp(href, (app && app.identifier) || ident || ''));
box.appendChild(row);
});
if (sub) {
sub.textContent = box.childElementCount
? '挑一个记一笔,今天的第一只小脚丫就会印上来'
: '去上面的工具记一笔,今天的第一只小脚丫就会印上来';
}
const n = box.childElementCount;
if (cnt) cnt.textContent = n ? '0 / ' + n : '';
if (sub) sub.textContent = n ? '完成任意一件,今天的第一只小脚丫就会印上来' : '去上面的工具记一笔,今天的第一只小脚丫就会印上来';
}
/* 加载中的中性占位(不是假数据):与 index.html 里那条首屏占位同构 */
@@ -4194,10 +4201,6 @@
d.append(dot, card);
return d;
}
const FP_DEMO = [
{ at: '09:12', label: '数胎动 12 次,小家伙今天特别活跃', app: '数胎动', detail: '1 小时内' },
{ at: '20:30', label: '体重 58.6 kg,比上周稳稳 +0.3', app: '孕期体重', detail: '' },
];
const FP_FOOT = '<svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg>';
/* 无足迹占位行:同构的一行,读屏和眼睛都不会把空卡当成坏卡。 */

View File

@@ -3389,3 +3389,24 @@ a.skip:focus{left:16px;top:16px}
.pt-day.is-sel:not(.is-today) i{background:none;color:#C24A30;text-decoration:underline;text-underline-offset:3px}
.pt-badge{display:inline-flex;align-items:center;gap:6px}
.pt-badge::before{content:"";width:6px;height:6px;border-radius:1.5px;background:#F4593C;transform:rotate(45deg)}
/* ================= 今日脚印 · 今日待办(2026-10-02)=================
今天一个工具都没用时:一张待办清单,每行 = 空心勾选框 + 一句要做的事(粗)+ 怎么做(细)+ 应用图标 + 「去完成」。 */
.fp2 .fp-todo{text-align:left;padding:14px 14px 12px}
.td-head{display:flex;align-items:baseline;gap:8px}
.td-head b{font-size:15px;font-weight:900;color:var(--ink)}
.td-cnt{font-size:12px;font-weight:700;color:#2FA57C;font-variant-numeric:tabular-nums}
.fp2 .td-lead{display:block;margin-top:4px;font-family:inherit;font-size:12.5px;font-weight:500;line-height:1.55;color:#6E8A7E}
.fp2 .td-list{display:flex;flex-direction:column;gap:0;margin-top:8px}
.td-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px 0;border:0;background:none;font:inherit;text-align:left;
border-top:1px dashed rgba(90,160,130,.22)}
.td-row:first-child{border-top:0}
.td-box{flex:0 0 18px;width:18px;height:18px;border-radius:6px;border:2px solid #9BD3BA;background:#fff}
.td-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.td-txt b{font-size:14px;font-weight:800;color:#3A2C27}
.td-txt em{font-style:normal;font-size:11.5px;color:#9A8A82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-ico{flex:0 0 24px;width:24px;height:24px;border-radius:7px;object-fit:cover}
.td-go{flex:0 0 auto;font-size:12px;font-weight:800;color:#23946C}
.td-go::after{content:" ›"}
.td-row:active .td-box{background:#DDF3E9}
.fp2 .td-foot{display:block;margin-top:6px;padding-top:9px;border-top:1px solid rgba(90,160,130,.15);font-size:11.5px;color:#8FA89D;text-align:center}