diff --git a/index.html b/index.html index c40817f..731326a 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ 妈妈盒子 · 孕育陪伴 - - + + @@ -704,7 +704,17 @@ 妈妈的回信和宝宝的再回复都作为 .lt-sub 挂在这封信下面, 一眼就能看出「这条回信是回给哪封来信的」 -->
-
这里还没有内容
+ +
+ + 这里还没有内容 +
@@ -1761,8 +1771,8 @@ 加载失败/离线时 window.wx 为 undefined,goMall() 会降级为 toast 提示, 不影响应用其余功能。 --> - - -
v26090724
+ + +
v26090725
diff --git a/js/app.js b/js/app.js index 4f3cfa5..686e157 100644 --- a/js/app.js +++ b/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() 会原样跳过它们。等用户切回「全部」,这些从没截过的整段话 diff --git a/mama-box.css b/mama-box.css index 817c656..212927b 100644 --- a/mama-box.css +++ b/mama-box.css @@ -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)}