首页:数据与图标合成一张卡去虚线;工具默认6个最多8个,满8隐藏添加格;编辑弹层加号居中;本周话题改为对未来宝宝说的话;其他妈妈也在搜标题去斜体 v26110106

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-01 04:39:44 +00:00
parent eece929571
commit 05ef51bf41
2 changed files with 22 additions and 14 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:26110105 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<!-- V:26110106 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css">
<link rel="stylesheet" href="night.css">
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
@@ -385,6 +385,11 @@
.vt-more{border-radius:0;background:#fff;height:34px;margin-top:0}
/* 图标下的状态胶囊也统一成一个暖灰色,颜色只留给正式 logo,不再一格一个色 */
.tg .tg-s{background:#F7EFEB;color:#8A6458}
/* 2026-11-01 用户:数据格和图标宫格之间的虚线去掉,做成一体——同一张白底卡:上半数据 2×2,下半图标,中间一条发丝线 */
.vt{border-radius:18px 18px 0 0;border-bottom:0;box-shadow:none}
.vt + .tg-grid{margin-top:0;padding:16px 4px 12px;border:1px solid #F3E4DD;border-radius:0 0 18px 18px;background:#fff;box-shadow:0 6px 16px rgba(170,110,90,.06)}
.vt.hide + .tg-grid{padding:16px 4px 12px;border:1px solid #F3E4DD;border-radius:18px;background:#fff}
html.night .vt + .tg-grid,html.night .vt.hide + .tg-grid{background:#2B2230;border-color:rgba(255,255,255,.08)}
.tg.is-warn .tg-s{background:#FDE3E0;color:#D2453B}
html.night .vt{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.08)}
html.night .vt-it,html.night .vt-more{background:#2B2230}
@@ -426,7 +431,9 @@
.hts-add{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;padding:12px 2px 10px;border:0;border-radius:14px;background:#fff;font:inherit;color:#3B2A2A}
.hts-add img,.hts-add .hts-ic{width:34px;height:34px}
.hts-add span{max-width:100%;font-size:11.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hts-add b{position:absolute;top:5px;right:6px;width:18px;height:18px;border-radius:50%;background:#2FA36B;color:#fff;font-size:15px;line-height:17px;font-weight:700}
.hts-add b{position:absolute;top:5px;right:6px;width:18px;height:18px;border-radius:50%;background:#2FA36B;font-size:0;color:transparent}
.hts-add b::before,.hts-add b::after{content:"";position:absolute;left:50%;top:50%;width:10px;height:2px;margin:-1px 0 0 -5px;border-radius:1px;background:#fff}
.hts-add b::after{transform:rotate(90deg)}
.hts-add.is-full{opacity:.45}
.hts-empty{grid-column:1/-1;padding:14px 0;text-align:center;font-size:12.5px;color:#9A8380}
.hts-foot{display:flex;gap:10px;padding:10px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #F0E6E0}
@@ -504,7 +511,7 @@
<button type="button" class="ms-all ripple hide" id="msAll"></button>
<style>
.ms-head{display:flex;align-items:center;gap:8px}
.ms-title{margin:0;font-size:21px;font-weight:900;font-style:italic;letter-spacing:.5px;color:#2A1E1E}
.ms-title{margin:0;font-size:21px;font-weight:900;letter-spacing:.5px;color:#2A1E1E}
.ms-title span{background:linear-gradient(transparent 58%,#FFE066 58%,#FFE066 92%,transparent 92%);padding:0 3px}
.ms-wk{margin-left:auto;padding:2px 9px;border-radius:99px;background:#FFEDE6;color:#E0573A;font-size:11.5px;font-weight:700}
.ms-who{display:flex;align-items:center;gap:8px;margin:10px 0 4px}
@@ -1901,7 +1908,7 @@
<div class="hts-head">
<div>
<h2 id="htsT">编辑首页工具</h2>
<p id="htsSub">长按拖动排序,首页最多放 6 个</p>
<p id="htsSub">长按拖动排序,首页最多放 8 个</p>
</div>
<button class="sheet-close" id="htsX" type="button" aria-label="关闭"><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M3.5 3.5l9 9M12.5 3.5l-9 9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>
</div>
@@ -2336,7 +2343,7 @@
<!-- 2026-10-05 首页头图:宝宝时不时动一动小手小脚(独立文件,删掉这一行即下线) -->
<script src="js/baby-limbs.js?v=26101201"></script>
<script src="js/coach.js?v=26101211"></script>
<script src="js/birth-flow.js?v=26110105"></script>
<script src="js/birth-flow.js?v=26110106"></script>
<!-- 禁止下拉回弹(2026-10-11 统一规则,与孕期体重同一段):竖向拖动时从手指下往上找还能朝该方向滚的容器,找不到才拦;横滑、双指、可滚列表不受影响 -->
<script>

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26110105';
var VER = '26110106';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -426,7 +426,7 @@
· 一个模块两层,二者完全解耦(同日二改,用户看过预览后定):
① #vitals 数据卡 = 「用过哪个记录类工具」:有真实记录就出,最近记录的在前,最多露 4 张、多的折叠(renderVitals);
一条真实记录都没有 → 胎动 / 体重 / 血压 / 血糖 4 张示例数卡。访客 / 产后不出。
② #htGrid 图标宫格 = 「编辑」列表:显示哪些、什么顺序,最多 HT_MAX=6 个 + 末尾「添加」格,记录类工具也以图标出现。
② #htGrid 图标宫格 = 「编辑」列表:显示哪些、什么顺序,最多 HT_MAX=8 个,不满时末尾「添加」格,记录类工具也以图标出现。
「全部工具」不占格子,在标题右侧「全部 ›」。
· 顺序 = localStorage HT_KEY(identifier 数组)。没存过 = HT_DEFAULT + 孕周替补(原 swapHomeCards 规则:没到门槛的坑位按 SWAP_POOL 换);
存过 = 完全以用户为准,没到门槛的不替换,显示「孕N周开放」、点了由 jumpApp 弹原提示。
@@ -434,7 +434,7 @@
回来后下架的自动不出现(不在前端写名单)。
· 7 个老格子(data-mini)和 6 张数据卡的 DOM 一直都在,只挪位置 / 显隐 —— 卡片接口回填、此刻 tapMini 点它们照旧能用。 */
const HT_KEY = 'mmbox.homeTools.v1', HT_META_KEY = 'mmbox.homeTools.meta.v1';
const HT_MAX = 6, HT_MIN = 1, VT_SHOW = 4; /* 2026-11-01 用户:首页固定最多 6 个工具 + 末尾「添加」格(点开编辑) */
const HT_MAX = 8, HT_MIN = 1, VT_SHOW = 4; /* 2026-11-01 用户:默认放 6 个,编辑里最多放到 8 个;不满 8 个时末尾有「添加」格(点开编辑),满了隐藏 */
const HT_DEFAULT = ['taidong', 'yunqitizhong', 'chanjianrili', 'taierguzhong', 'gongsuopinlv', 'yun'];
const VT_ORDER = ['kick', 'weight', 'bp', 'glu', 'curve', 'fweight'];
const VT_TOOL = { kick: 'taidong', weight: 'yunqitizhong', bp: 'yun', glu: 'yunqixuetang', curve: 'gongsuopinlv', fweight: 'taierguzhong' }; /* 拿不到记录时间时的兜底顺序;前 4 个也是「没有任何记录」时的示例卡 */
@@ -555,6 +555,7 @@
add.addEventListener('click', e => { e.stopPropagation(); const b = $('#htEdit'); if (b) b.click(); });
}
grid.appendChild(add);
add.classList.toggle('hide', list.length >= HT_MAX);
/* 孕周门槛角标:只有用户自己放上来的才会锁着出现(默认列表里锁着的已经换成替补) */
let anyLock = false;
$$('.tg[data-tool]', grid).forEach(el => {
@@ -4221,12 +4222,12 @@
后端将来若在 /whisper 返回 theme(同结构),以后端为准。
presets 只是「不知道说什么?点一句」的示范句,发出去时不在服务端预设库里 → 照常走微信内容安全审核。 */
const WH_THEMES = [
/* 2026-10-02 用户:本周话题由「对宝宝说的话」改成「对老公说的话」 */
{ from: '2026-09-28', name: '对老公说的话',
tip: '那些不好意思当面说的,悄悄放进星空',
say: '对老公说一句悄悄话', ph: '老公,其实我想跟你说……',
presets: ['老公,辛苦你了,下班还给我揉腿', '谢谢你半夜陪我起来上厕所', '产检那天你请假陪我,我偷偷开心了好久',
'我胖了、脾气也大了,谢谢你都接住了', '等宝宝出来,我们也要好好的', '你一定会是个好爸爸'] },
/* 2026-10-02 用户:本周话题由「对宝宝说的话」改成「对老公说的话」;2026-11-01 用户:改成「对未来宝宝说的话」 */
{ from: '2026-09-28', name: '对未来宝宝说的话',
tip: '想对还没见面的宝宝说的,悄悄放进星空',
say: '对未来宝宝说一句悄悄话', ph: '宝宝,妈妈想跟你说……',
presets: ['宝宝,妈妈每天都在等你', '不用多优秀,健康快乐就好', '今天你踢了我好多下,妈妈都记着呢',
'等你来了,带你去看海', '谢谢你选中我做你的妈妈', '我们很快就见面啦'] },
];
function theme() {
if (data && data.theme && data.theme.name) return data.theme;