feat(首页): 删掉孕期每日小打卡;工具卡图标只留 LOGO 里的图形并改矢量 (v26093021)

- 删除首页「孕期每日小打卡」模块:HTML、.daily-check/.dc-* 样式、renderDaily 及产后收起逻辑、
  三张专用图标。工具区重新成为首页第一块(首块间距规则本就按 :first-child 走)。
- 五张工具卡图标去掉 LOGO 外面的圆角方块 / 圆环底,只留里面的图形,全部改成 SVG:
  数胎动小脚丫、胎儿估重表盘、数宫缩波形直接取自工具页原 SVG;
  孕期体重(原图 128px webp)、孕检日历(原图 100px png)原图太小放大发糊,照原图配色重画为矢量。
- 图标位置微调,避开「记录」按钮和标题。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 17:00:21 +00:00
parent d164688743
commit a7e71fda2d
16 changed files with 28 additions and 125 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26093020';
var VER = '26093021';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -1048,8 +1048,6 @@
if (p) p.classList.toggle('is-empty', !!on);
}
function syncPregnancy() {
/* 孕期每日小打卡:产后整块收起;其它状态都显示(标签默认是中性提示,不依赖孕周) */
const _dc = $('#dailyCheck'); if (_dc) _dc.classList.toggle('hide', !!state.postpartum);
/* 孕期小知识:只认真实孕周(自己判显隐,见 renderTips) */
renderTips();
/* ---- 产后态:宝宝已出生 → 一律不显示孕周数字(2026-09-22) ----
@@ -3060,53 +3058,6 @@
}
mark('curve', cv);
}
renderDaily(r.day, k, w, cal);
}
/* 孕期每日小打卡(2026-09-30):把 kick / weight / cal 三槽翻成一句话的状态标签。
数据就是上面这份卡片接口,不另打请求;槽缺失就保留 HTML 里的中性提示(不造数)。
「今天」以接口顶层 day(上游 YYYY-MM-DD,北京时间)为准,别拿本机时钟比 ——
容器/手机时区不一定是东八区,差一天就会把「今日已称」判成「还没称」。
⚠️ 上游字符串一律 textContent。 */
function renderDaily(day, k, w, cal) {
const tag = (id, text, kind) => {
const el = $(id); if (!el) return;
el.textContent = text;
el.classList.toggle('is-done', kind === 'done');
el.classList.toggle('is-warn', kind === 'warn');
};
const d10 = v => (v ? String(v).slice(0, 10) : '');
let done = 0, total = 0;
if (k) {
total++;
const n = parseInt(k.value, 10) || 0;
if (n > 0) { done++; tag('#dcKick', '今日已记 ' + n + ' 次', 'done'); }
else tag('#dcKick', '今天还没记', '');
}
if (w) {
total++;
if (day && d10(w.at) === day) { done++; tag('#dcWeight', '今日已称', 'done'); }
else tag('#dcWeight', '今天还没称', '');
}
if (cal) {
/* sub 形如「糖耐 · 孕25周」,取「·」前那段当检查名;拿不到就叫「产检」。
NT 这类字母名前后补空格:「距 NT 还有 7 天」。 */
let nm = String(cal.sub || '').split('·')[0].trim() || '产检';
if (/^[A-Za-z]/.test(nm)) nm = ' ' + nm + ' ';
const at = d10(cal.at);
const diff = (at && day) ? Math.round((Date.parse(at) - Date.parse(day)) / 864e5) : NaN;
if (cal.warn) tag('#dcCal', cal.label && cal.label !== '下次产检' ? cal.label : '待补记', 'warn');
else if (cal.empty || isNaN(diff) || diff < 0) tag('#dcCal', '看产检安排', '');
else if (diff === 0) tag('#dcCal', '今天' + nm.trim() + (nm.trim() === '产检' ? '' : '检查'), 'warn');
else tag('#dcCal', '距' + nm + '还有 ' + diff + ' 天', '');
}
/* 抬头右端「今日已完成 1/2」:只数每天要做的两件(胎动、体重),产检不是每天的事 */
const dd = $('#dcDone');
if (dd && total) {
dd.textContent = '今日已完成 ' + done + '/' + total;
dd.classList.toggle('is-all', done === total);
dd.classList.remove('hide');
}
}
/* ================= 宝宝消消乐 · 推广入口(2026-09-30) =================