今日脚印:无记录时改为「今日待办」清单;宝宝今天想说去掉 AI 角标
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
91
js/app.js
91
js/app.js
@@ -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>';
|
||||
|
||||
/* 无足迹占位行:同构的一行,读屏和眼睛都不会把空卡当成坏卡。 */
|
||||
|
||||
Reference in New Issue
Block a user