访客态: 无openid(匿名加载兜底)时全站占位引导, 隐藏脚印时间轴, 杜绝演示数据落定 (v26090737)
This commit is contained in:
10
index.html
10
index.html
@@ -7,8 +7,8 @@
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>妈妈盒子 · 孕育陪伴</title>
|
||||
<!-- V:26090736 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
|
||||
<link rel="stylesheet" href="mama-box.css?v=26090736">
|
||||
<!-- V:26090737 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
|
||||
<link rel="stylesheet" href="mama-box.css?v=26090737">
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -1774,8 +1774,8 @@
|
||||
加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示,
|
||||
不影响应用其余功能。 -->
|
||||
|
||||
<script src="js/app.js?v=26090736"></script>
|
||||
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090736 -->
|
||||
<div id="ver" style="position:fixed;left:0;right:0;bottom:10px;text-align:center;z-index:9999;pointer-events:none;color:#B3A69C;font-size:10px;letter-spacing:.5px">v26090736</div>
|
||||
<script src="js/app.js?v=26090737"></script>
|
||||
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090737 -->
|
||||
<div id="ver" style="position:fixed;left:0;right:0;bottom:10px;text-align:center;z-index:9999;pointer-events:none;color:#B3A69C;font-size:10px;letter-spacing:.5px">v26090737</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
19
js/app.js
19
js/app.js
@@ -1894,6 +1894,9 @@
|
||||
孕周数字换成引导文案,避免新用户看到"孕 27 周"这类假数据。 */
|
||||
if (state.pregEmpty) {
|
||||
const nm = state.babyName || '宝宝';
|
||||
/* 脚印时间轴是纯演示内容(无真实数据源),访客/未完善态整块隐藏 */
|
||||
const _tl = document.querySelector('.today-line');
|
||||
if (_tl) _tl.style.display = 'none';
|
||||
/* ① 我的 · 孕期卡 → 引导 */
|
||||
$('#pcTitle').textContent = '待完善孕期信息';
|
||||
$('#pcSub').textContent = '填好预产期,开启孕期陪伴';
|
||||
@@ -1941,6 +1944,8 @@
|
||||
return;
|
||||
}
|
||||
const week = state.week, day = state.day, name = state.babyName;
|
||||
const _tl2 = document.querySelector('.today-line');
|
||||
if (_tl2) _tl2.style.display = '';
|
||||
const days = week * 7 + day; // 一起生活了多少天
|
||||
const weekTxt = '孕 ' + week + ' 周' + (day ? ' +' + day + ' 天' : '');
|
||||
/* 剩余天数按 40 周足月倒推,比直接用 date 差值更贴合「孕周」这个语境 */
|
||||
@@ -4214,7 +4219,19 @@
|
||||
if (_profileApplied) return; // init 只跑一次,防重复 fetch
|
||||
_profileApplied = true;
|
||||
const openid = hashParam('openid');
|
||||
if (!openid) return;
|
||||
/* 访客态:宿主未注入身份(冷启动 silenceAuth 失败走「匿名加载 H5」兜底)。
|
||||
⚠️ 绝不能停在内置演示默认值上(小汤圆/孕27周/回信啦 都是前端现算的假数据)——
|
||||
全部切占位/引导;宿主拿到身份后会带 openid 重载本页,届时自动切真实数据。 */
|
||||
if (!openid) {
|
||||
state.pregEmpty = true;
|
||||
state.due = null; state.week = null; state.day = null;
|
||||
state.babyName = ''; state.userName = '';
|
||||
LETTERS.splice(0, LETTERS.length);
|
||||
state.curLetter = ''; state.homeLetter = '';
|
||||
syncPregnancy(); /* 占位 + 隐藏脚印时间轴 + 信件引导态 */
|
||||
syncLetterCounts(); /* hero 计数 '--'、未读角标隐藏 */
|
||||
return;
|
||||
}
|
||||
const base = '/api/mp/public/mama-box/';
|
||||
/* 并行拉 个人档案 + 孕期状态:
|
||||
- profile:babyName/userName/babySex/dueDate(身份 + 建档字段)
|
||||
|
||||
Reference in New Issue
Block a user