From da740ba07e60242f1b4d2f4e942f50e2387ec9af Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Wed, 30 Sep 2026 17:13:01 +0000 Subject: [PATCH] =?UTF-8?q?feat(=E9=A2=84=E8=A7=88):=20=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E9=A1=B5=E4=BA=94=E5=BC=A0=E5=B7=A5=E5=85=B7=E5=8D=A1=E5=A1=AB?= =?UTF-8?q?=E4=B8=80=E7=BB=84=E7=A4=BA=E4=BE=8B=E6=95=B0=E6=8D=AE=20(v2609?= =?UTF-8?q?3024)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 只在 /mama-box-preview/ 路径下生效,用于看排版效果;正式首页 /mama-box/ 不受影响, 照旧显示真实数据或「--」(AGENTS §4.2 不造假数据)。示例数据按 tool-cards 接口结构 直接喂给 applyRemoteCards:数胎动 12 次、体重 58.2kg、糖耐 10月8日、估重约 1250g、宫缩间隔 5分20秒。 Co-Authored-By: Claude Opus 5.5 --- index.html | 2 +- js/app.js | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7a10d2b..e782a01 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + diff --git a/js/app.js b/js/app.js index 2f928ac..9a930cc 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26093023'; + var VER = '26093024'; const $ = (s, c) => (c || document).querySelector(s); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); @@ -3261,7 +3261,24 @@ })(); /* 拉卡片数据(与其它远程数据一起打;失败静默,卡上保留现有值) */ + /* 预览环境专用的一组示例数据(2026-09-30 用户要求:五张工具卡填一组示例数据,看排版效果)。 + ⚠️ 只在 /mama-box-preview/ 路径下生效,正式首页(/mama-box/)永远走不到这里 —— + 2026-09-22 出过写死演示值被所有用户看到的事故(AGENTS §4.2 不造假数据), + 所以示例数据绝不能靠「接口没回来就兜底」这种条件触发,只认预览路径。 + 结构照搬 tool-cards 接口,直接喂给 applyRemoteCards,渲染逻辑一行不多写。 */ + const DEMO_CARDS = location.pathname.indexOf('/mama-box-preview/') === 0 ? { + ok: true, day: '2026-09-30', + cards: [ + { slot: 'kick', value: '12', sub: '3 段 · 最近 14:20' }, + { slot: 'weight', value: '58.2', unit: 'kg', sub: '比上周 +0.3kg' }, + { slot: 'cal', text: '10月8日 糖耐' }, + { slot: 'fweight', text: '约 1250g' }, + { slot: 'curve', value: '5分20秒' }, + ], + } : null; + function applyRemoteCardsFetch() { + if (DEMO_CARDS) { applyRemoteCards(DEMO_CARDS); return; } const openid = hashParam('openid'); if (!openid) return; // 访客态不问(接口要 openid) const unionid = hashParam('unionid');