diff --git a/index.html b/index.html index 4a869ad..d204edb 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + diff --git a/js/app.js b/js/app.js index cf43ad1..5d4379a 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26100433'; + var VER = '26100434'; const $ = (s, c) => (c || document).querySelector(s); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); @@ -769,8 +769,16 @@ 一封就圈 1、两封就圈 2」→ 首页卡永远收起,未读数(信 + 回信)直接写进底 tab 的红圈里。 */ hideLetterCard(); const n = (Number(r.unreadLetters) || 0) + (Number(r.unreadReplies) || 0) || Number(r.unread) || 0; - if (badge) badge.textContent = n > 99 ? '99+' : String(n); - if (badge) badge.classList.add('show'); + /* 2026-10-04 「宝宝来信(新)」会话转产品:「一封信圈一,两封信圈二」→ 1~10 画成圈数字(①~⑩ 的样子: + 白底红圈红字,CSS .t-badge.is-ring 画圈,不用 ① 字符本身 —— 各家字体里大小/粗细不一,叠在 tab 上会糊); + >10 换成实心红胶囊「10+」。读屏读 aria-label。 */ + if (badge) { + badge.textContent = n > 10 ? '10+' : String(n); + badge.classList.toggle('is-ring', n <= 10); + badge.classList.toggle('d2', n === 10); // ⑩ 两位数,圈里字缩小 + badge.setAttribute('aria-label', n + ' 封未读来信'); + badge.classList.add('show'); + } } /* 2026-10-02 底部导航:「宝宝来信」tab 的信封在有红点时轻轻晃(CSS .has-new)。 红点的 owner 仍是 renderLetterReminder,这里只跟着它的 .show 走,不另立判据。 */ @@ -5239,6 +5247,8 @@ document.addEventListener('visibilitychange', function () { if (!document.hidden) syncLaixinReminder(); }); + /* 从来信页「返回」时浏览器可能直接从往返缓存(bfcache)恢复本页,不一定触发 visibilitychange → 补一个 pageshow */ + addEventListener('pageshow', function (e) { if (e.persisted) syncLaixinReminder(); }); /* 「授权完善资料」:H5 → navigateTo → 小程序端独立授权页(pages/annex/auth/index)。 说明:微信 web-view 的 postMessage 非实时送达(只在分享/后退/onHide 等时机 diff --git a/mama-box.css b/mama-box.css index 62d5b55..fb7788b 100644 --- a/mama-box.css +++ b/mama-box.css @@ -4633,3 +4633,7 @@ a.skip:focus{left:16px;top:16px} .hero-zod.el-earth{--zg:linear-gradient(135deg,rgba(205,178,131,.28),rgba(167,138,90,.28) 55%,rgba(133,112,72,.30))} .hero-zod.el-air {--zg:linear-gradient(135deg,rgba(159,189,240,.28),rgba(135,150,224,.28) 55%,rgba(115,120,204,.30))} .hero-zod.el-water{--zg:linear-gradient(135deg,rgba(93,192,211,.28),rgba(58,144,194,.28) 55%,rgba(46,106,164,.30))} +/* 来信角标:1~10 画成圈数字(白底红圈红字 = ①~⑩ 的样子;js renderLetterReminder 加 .is-ring),>10 保持实心红胶囊「10+」 */ +.t-badge.is-ring{width:17px;min-width:0;padding:0;background:#fff;border:1.5px solid #FF3B30;color:#FF3B30; + font:800 10.5px/14px -apple-system,"PingFang SC",sans-serif;box-shadow:0 0 0 1.5px #fff,0 2px 6px rgba(255,59,48,.30)} +.t-badge.is-ring.d2{font-size:8.5px;letter-spacing:-.4px}