feat(预览): 预览页五张工具卡填一组示例数据 (v26093024)
只在 /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 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>兜爸心选 · 孕育陪伴</title>
|
||||
<!-- V:26093023 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<!-- V:26093024 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<link rel="stylesheet" href="mama-box.css">
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->
|
||||
|
||||
19
js/app.js
19
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');
|
||||
|
||||
Reference in New Issue
Block a user