首页工具最多6个+添加格 v26110104

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-01 04:26:05 +00:00
parent 4b474d755b
commit be8656a415
2 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title> <title>兜爸心选 · 孕育陪伴</title>
<!-- V:26110103 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 --> <!-- V:26110104 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css"> <link rel="stylesheet" href="mama-box.css">
<link rel="stylesheet" href="night.css"> <link rel="stylesheet" href="night.css">
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) --> <!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
@@ -1886,7 +1886,7 @@
<div class="hts-head"> <div class="hts-head">
<div> <div>
<h2 id="htsT">编辑首页工具</h2> <h2 id="htsT">编辑首页工具</h2>
<p id="htsSub">长按拖动排序,首页最多放 7 个</p> <p id="htsSub">长按拖动排序,首页最多放 6 个</p>
</div> </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> <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> </div>
@@ -2321,7 +2321,7 @@
<!-- 2026-10-05 首页头图:宝宝时不时动一动小手小脚(独立文件,删掉这一行即下线) --> <!-- 2026-10-05 首页头图:宝宝时不时动一动小手小脚(独立文件,删掉这一行即下线) -->
<script src="js/baby-limbs.js?v=26101201"></script> <script src="js/baby-limbs.js?v=26101201"></script>
<script src="js/coach.js?v=26101211"></script> <script src="js/coach.js?v=26101211"></script>
<script src="js/birth-flow.js?v=26110103"></script> <script src="js/birth-flow.js?v=26110104"></script>
<!-- 禁止下拉回弹(2026-10-11 统一规则,与孕期体重同一段):竖向拖动时从手指下往上找还能朝该方向滚的容器,找不到才拦;横滑、双指、可滚列表不受影响 --> <!-- 禁止下拉回弹(2026-10-11 统一规则,与孕期体重同一段):竖向拖动时从手指下往上找还能朝该方向滚的容器,找不到才拦;横滑、双指、可滚列表不受影响 -->
<script> <script>

View File

@@ -3,7 +3,7 @@
(function () { (function () {
'use strict'; 'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26110103'; var VER = '26110104';
const $ = (s, c) => (c || document).querySelector(s); const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -426,7 +426,7 @@
· 一个模块两层,二者完全解耦(同日二改,用户看过预览后定): · 一个模块两层,二者完全解耦(同日二改,用户看过预览后定):
① #vitals 数据卡 = 「用过哪个记录类工具」:有真实记录就出,最近记录的在前,最多露 4 张、多的折叠(renderVitals); ① #vitals 数据卡 = 「用过哪个记录类工具」:有真实记录就出,最近记录的在前,最多露 4 张、多的折叠(renderVitals);
一条真实记录都没有 → 胎动 / 体重 / 血压 / 血糖 4 张示例数卡。访客 / 产后不出。 一条真实记录都没有 → 胎动 / 体重 / 血压 / 血糖 4 张示例数卡。访客 / 产后不出。
② #htGrid 图标宫格 = 「编辑」列表:显示哪些、什么顺序,最多 HT_MAX=7 个 + 末尾「添加」格(4×2),记录类工具也以图标出现。 ② #htGrid 图标宫格 = 「编辑」列表:显示哪些、什么顺序,最多 HT_MAX=6 个 + 末尾「添加」格,记录类工具也以图标出现。
「全部工具」不占格子,在标题右侧「全部 ›」。 「全部工具」不占格子,在标题右侧「全部 ›」。
· 顺序 = localStorage HT_KEY(identifier 数组)。没存过 = HT_DEFAULT + 孕周替补(原 swapHomeCards 规则:没到门槛的坑位按 SWAP_POOL 换); · 顺序 = localStorage HT_KEY(identifier 数组)。没存过 = HT_DEFAULT + 孕周替补(原 swapHomeCards 规则:没到门槛的坑位按 SWAP_POOL 换);
存过 = 完全以用户为准,没到门槛的不替换,显示「孕N周开放」、点了由 jumpApp 弹原提示。 存过 = 完全以用户为准,没到门槛的不替换,显示「孕N周开放」、点了由 jumpApp 弹原提示。
@@ -434,7 +434,7 @@
回来后下架的自动不出现(不在前端写名单)。 回来后下架的自动不出现(不在前端写名单)。
· 7 个老格子(data-mini)和 6 张数据卡的 DOM 一直都在,只挪位置 / 显隐 —— 卡片接口回填、此刻 tapMini 点它们照旧能用。 */ · 7 个老格子(data-mini)和 6 张数据卡的 DOM 一直都在,只挪位置 / 显隐 —— 卡片接口回填、此刻 tapMini 点它们照旧能用。 */
const HT_KEY = 'mmbox.homeTools.v1', HT_META_KEY = 'mmbox.homeTools.meta.v1'; const HT_KEY = 'mmbox.homeTools.v1', HT_META_KEY = 'mmbox.homeTools.meta.v1';
const HT_MAX = 7, HT_MIN = 1, VT_SHOW = 4; /* 2026-11-01 用户:默认 6 个 + 末尾「添加」格(点开编辑),最多 7 个工具 + 添加格 = 4×2 */ const HT_MAX = 6, HT_MIN = 1, VT_SHOW = 4; /* 2026-11-01 用户:首页固定最多 6 个工具 + 末尾「添加」格(点开编辑) */
const HT_DEFAULT = ['taidong', 'yunqitizhong', 'chanjianrili', 'taierguzhong', 'gongsuopinlv', 'yun']; const HT_DEFAULT = ['taidong', 'yunqitizhong', 'chanjianrili', 'taierguzhong', 'gongsuopinlv', 'yun'];
const VT_ORDER = ['kick', 'weight', 'bp', 'glu', 'curve', 'fweight']; 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 个也是「没有任何记录」时的示例卡 */ const VT_TOOL = { kick: 'taidong', weight: 'yunqitizhong', bp: 'yun', glu: 'yunqixuetang', curve: 'gongsuopinlv', fweight: 'taierguzhong' }; /* 拿不到记录时间时的兜底顺序;前 4 个也是「没有任何记录」时的示例卡 */