孕期首页过渡:询问层放在首页引导之下、首次等 5 秒;37 周卡标题缩短
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
'.bf-me{display:flex;align-items:center;gap:10px;width:100%;margin-top:12px;padding:14px 16px;border:0;border-radius:18px;background:#fff;text-align:left;font-size:15px;color:#2B2320;box-shadow:0 2px 10px rgba(80,40,20,.05)}' +
|
||||
'.bf-me i{font-style:normal}.bf-me .bf-me-ic{flex:none;width:30px;height:30px;border-radius:10px;background:#FFE0D1;display:flex;align-items:center;justify-content:center}' +
|
||||
'.bf-me .bf-me-t{flex:1}.bf-me .bf-me-v{font-size:12.5px;color:#9A8E86}.bf-me .bf-me-a{color:#C9BEB6}' +
|
||||
'.bf-ov{position:fixed;inset:0;z-index:400;display:none;background:rgba(30,20,15,.45);font-family:inherit;color:#2B2320}' +
|
||||
'.bf-ov{position:fixed;inset:0;z-index:135;display:none;background:rgba(30,20,15,.45);font-family:inherit;color:#2B2320}' +
|
||||
'.bf-ov.on{display:flex;align-items:flex-end}' +
|
||||
'.bf-sheet{width:100%;background:#fff;border-radius:22px 22px 0 0;padding:22px 20px calc(22px + env(safe-area-inset-bottom));animation:bfUp .3s ease}' +
|
||||
'@keyframes bfUp{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}' +
|
||||
@@ -198,7 +198,7 @@
|
||||
if (S.postpartum) {
|
||||
card = '<div class="bf-card born" id="bfCard"><div class="bf-ic">' + BABY('#2F8A5E', 26) + '</div><div class="bf-tx"><b>宝宝已出生</b>育儿首页按宝宝月龄推荐工具,孕期记录也都在</div><button class="bf-go" data-bf-open="baby">去育儿首页</button></div>';
|
||||
} else if (S.week != null && S.week >= 37) {
|
||||
card = '<div class="bf-card" id="bfCard"><div class="bf-ic">' + HEART + '</div><div class="bf-tx"><b>宝宝随时可能来报到</b>出生后点一下告诉我们,首页会换成育儿模式,孕期记录都保留</div><button class="bf-go" data-bf-open="reg">宝宝出生了</button></div>';
|
||||
card = '<div class="bf-card" id="bfCard"><div class="bf-ic">' + HEART + '</div><div class="bf-tx"><b>宝宝快来报到啦</b>出生后点一下,首页换成育儿模式,孕期记录都保留</div><button class="bf-go" data-bf-open="reg">宝宝出生了</button></div>';
|
||||
}
|
||||
if (card && home) home.insertAdjacentHTML('beforebegin', card);
|
||||
|
||||
@@ -214,14 +214,15 @@
|
||||
if (over < 1) return;
|
||||
var today = iso(new Date());
|
||||
try { if (!DEMO && localStorage.getItem(ASK_KEY) === today) return; localStorage.setItem(ASK_KEY, today); } catch (e) {}
|
||||
/* 等首页先渲染;首页使用引导、弹窗、底部弹层开着就再等等,别叠在一起 */
|
||||
/* 等首页先渲染 5 秒;首页使用引导、弹窗、底部弹层开着就再等等,别叠在一起。
|
||||
层级 135:高于弹窗(125),低于首页使用引导(140)——引导晚出来也会盖在上面,不会被挡 */
|
||||
var tries = 0;
|
||||
function wait() {
|
||||
var busy = $('.mb-coach.show') || $('.modal.show') || $('#sheet.show') || document.hidden;
|
||||
if (busy && ++tries < 90) return setTimeout(wait, 2000);
|
||||
if (!ov.classList.contains('on')) askSheet(over);
|
||||
}
|
||||
setTimeout(wait, 2500);
|
||||
setTimeout(wait, 5000);
|
||||
}
|
||||
|
||||
function apply(pg, pf) {
|
||||
|
||||
Reference in New Issue
Block a user