预览版默认对接真实接口:工具卡、脚印、档案入口不再固定用示例,仅 demo=1 / fpdemo=1 时显示示例 (v26100465)
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:26100464 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<!-- V:26100465 缓存版本标记:改 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) -->
|
||||
|
||||
11
js/app.js
11
js/app.js
@@ -3,7 +3,7 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||
var VER = '26100464';
|
||||
var VER = '26100465';
|
||||
const $ = (s, c) => (c || document).querySelector(s);
|
||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||
|
||||
@@ -291,7 +291,8 @@
|
||||
q.push('return_url=' + encodeURIComponent(location.href));
|
||||
/* demo=1:**预览路径一律带**(2026-10-05 用户:「档案页里的示例数据没有了」—— 预览是给人看效果的,要看到档案自己的示例,含 40 周旅程图);
|
||||
正式首页 /mama-box/ 永远不带 —— 档案页带了会忽略用户自己的数据(成长档案会话 19875b1b 明确要求正式入口不带)。 */
|
||||
if (location.pathname.indexOf('/mama-box-preview/') === 0) q.push('demo=1');
|
||||
/* 2026-10-08 用户:「把正式版对接后端接口都同步到预览版」→ 预览默认也看真实档案,只有显式 demo=1 才带。 */
|
||||
if (DEMO) q.push('demo=1');
|
||||
if (q.length) u += '?' + q.join('&');
|
||||
reportLastApp(ARCHIVE_H5, 'chengzhangdangan');
|
||||
reportHostLocation(u);
|
||||
@@ -4755,7 +4756,8 @@
|
||||
2026-09-22 出过写死演示值被所有用户看到的事故(AGENTS §4.2 不造假数据),
|
||||
所以示例数据绝不能靠「接口没回来就兜底」这种条件触发,只认预览路径。
|
||||
结构照搬 tool-cards 接口,直接喂给 applyRemoteCards,渲染逻辑一行不多写。 */
|
||||
const DEMO_CARDS = location.pathname.indexOf('/mama-box-preview/') === 0 ? {
|
||||
/* 2026-10-08 用户:「把正式版对接后端接口都同步到预览版」→ 预览默认也调真实 tool-cards,只有显式 demo=1(DEMO 已限定预览路径)才用示例。 */
|
||||
const DEMO_CARDS = DEMO ? {
|
||||
ok: true, day: '2026-09-30',
|
||||
cards: [
|
||||
{ slot: 'kick', value: '12', sub: '3 段 · 最近 14:20' },
|
||||
@@ -4890,7 +4892,8 @@
|
||||
/* ⚠️ 示例脚印(2026-10-03 用户:「多放两个脚印示例,数胎动、数宫缩、称体重」)——**只在预览环境**
|
||||
(路径含 mama-box-preview,或 hash 带 fpdemo=1)追加,用来看多条时的排版;正式版不会出现,不冒充真记录。
|
||||
确认样式后整段删掉即可。 */
|
||||
if (!DEMO && (/mama-box-preview/.test(location.pathname) || hashParam('fpdemo') === '1')) {
|
||||
/* 2026-10-08 起预览默认只显示真实脚印;要看多条排版,预览地址加 fpdemo=1。 */
|
||||
if (!DEMO && /mama-box-preview/.test(location.pathname) && hashParam('fpdemo') === '1') {
|
||||
rows.push(
|
||||
{ at: '09:20', label: '数胎动,宝宝动了 12 次', detail: '', app: '' },
|
||||
{ at: '11:05', label: '数宫缩 3 次,间隔约 8 分钟', detail: '', app: '' },
|
||||
|
||||
Reference in New Issue
Block a user