来信页空数据双态: 未完善资料→引导去完善(打开资料弹窗), 已完善无信→普通空提示 (v26090725)
This commit is contained in:
22
index.html
22
index.html
@@ -6,8 +6,8 @@
|
||||
<meta name="theme-color" content="#F4593C">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>妈妈盒子 · 孕育陪伴</title>
|
||||
<!-- V:26090724 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
|
||||
<link rel="stylesheet" href="mama-box.css?v=26090724">
|
||||
<!-- V:26090725 缓存版本标记:改 css/js 时同步 bump 该值,并给下方资源引用加 ?v= 以强制 webview 刷新子资源 -->
|
||||
<link rel="stylesheet" href="mama-box.css?v=26090725">
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -704,7 +704,17 @@
|
||||
妈妈的回信和宝宝的再回复都作为 .lt-sub 挂在这封信下面,
|
||||
一眼就能看出「这条回信是回给哪封来信的」 -->
|
||||
<div class="letter-list" id="letterList"></div>
|
||||
<div class="empty-tip" id="letterEmpty">这里还没有内容</div>
|
||||
<!-- 空数据双态:未完善资料 → 引导去完善(完善后才有来信);
|
||||
已完善但真没数据 → 普通"还没有内容"。由 renderLetters 按档案状态切换 -->
|
||||
<div class="empty-tip" id="letterEmpty">
|
||||
<div id="letterEmptyGuide" class="empty-guide" style="display:none">
|
||||
<div class="eg-emoji">💌</div>
|
||||
<p class="eg-t">宝宝还不知道预产期,没法给你写信</p>
|
||||
<p class="eg-s">先完善孕期信息,宝宝就会开始给你写信啦</p>
|
||||
<button class="eg-btn" id="letterGoOnboard">去完善资料</button>
|
||||
</div>
|
||||
<span id="letterEmptyPlain">这里还没有内容</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1761,8 +1771,8 @@
|
||||
加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示,
|
||||
不影响应用其余功能。 -->
|
||||
|
||||
<script src="js/app.js?v=26090724"></script>
|
||||
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090724 -->
|
||||
<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">v26090724</div>
|
||||
<script src="js/app.js?v=26090725"></script>
|
||||
<!-- 页面版本号(排查 webview 缓存):底部会显示 v26090725 -->
|
||||
<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">v26090725</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
13
js/app.js
13
js/app.js
@@ -993,6 +993,13 @@
|
||||
const hasMom = L => L.thread.some(m => m.who === 'mom');
|
||||
|
||||
/* ---------- 列表 ---------- */
|
||||
/* 来信页空数据 · 引导按钮:直接打开「我的资料」弹窗(保存后自动重载播种) */
|
||||
const letterGoOnboard = $('#letterGoOnboard');
|
||||
if (letterGoOnboard) letterGoOnboard.addEventListener('click', e => {
|
||||
e.stopPropagation();
|
||||
openModal('modalProfile');
|
||||
});
|
||||
|
||||
function renderLetters() {
|
||||
const list = $('#letterList');
|
||||
list.textContent = '';
|
||||
@@ -1192,6 +1199,12 @@
|
||||
});
|
||||
$$('.lgroup').forEach(g => g.classList.toggle('hide', !$$('.lthread:not(.hide)', g).length));
|
||||
$('#letterEmpty').classList.toggle('show', shown === 0);
|
||||
/* 空数据双态:未完善资料(pregEmpty)→ 引导去完善;已完善但无信 → 普通空提示。
|
||||
完善资料保存后会自动重载并播种样例信,引导按钮 = 打开「我的资料」弹窗。 */
|
||||
const needOnboard = !!state.pregEmpty && shown === 0;
|
||||
const guide = $('#letterEmptyGuide'), plain = $('#letterEmptyPlain');
|
||||
if (guide) guide.style.display = needOnboard ? 'block' : 'none';
|
||||
if (plain) plain.style.display = needOnboard ? 'none' : '';
|
||||
/* ⚠️ 必须放在这儿,不能只在 renderLetters 末尾调一次。
|
||||
.hide 是 display:none —— 被筛掉的那些线程量出来的 clientWidth 是 0,
|
||||
clampLine() 会原样跳过它们。等用户切回「全部」,这些从没截过的整段话
|
||||
|
||||
@@ -2650,3 +2650,11 @@ a.skip:focus{left:16px;top:16px}
|
||||
#appsGrid::-webkit-scrollbar{width:4px}
|
||||
#appsGrid::-webkit-scrollbar-thumb{background:#E0CFC5;border-radius:2px}
|
||||
#appsGrid::-webkit-scrollbar-track{background:transparent}
|
||||
|
||||
/* 来信页空数据 · 未完善资料引导态(区别于普通"还没有内容") */
|
||||
.empty-guide{padding:6px 0 2px}
|
||||
.empty-guide .eg-emoji{font-size:44px;line-height:1;margin-bottom:12px}
|
||||
.empty-guide .eg-t{font-size:15px;font-weight:700;color:var(--ink,#2B2320);margin-bottom:6px}
|
||||
.empty-guide .eg-s{font-size:12.5px;color:var(--muted,#A79C95);margin-bottom:18px;line-height:1.6}
|
||||
.empty-guide .eg-btn{display:inline-block;padding:11px 34px;border:none;border-radius:12px;background:#F4593C;color:#fff;font-size:14px;font-weight:700;cursor:pointer}
|
||||
.empty-guide .eg-btn:active{transform:scale(.97)}
|
||||
|
||||
Reference in New Issue
Block a user