feat(宿主恢复): 换应用上报 last_app + 首屏恢复上次 H5 应用 (v26092201)

需求:小程序里进入某个 H5 应用后退出小程序,再次冷启动要恢复那个应用。

- jumpApp / goArchiveH5 跳转前 reportLastApp():navigator.sendBeacon 上报**净地址**
  (实时、由浏览器保证投递,不依赖微信 postMessage 的延迟批量派发)
- init() 首屏 resumeLastApp():sessionStorage 一次性闸门内 GET /api/mp/public/last-app,
  命中就带当前 openid/unionid location.replace 过去 —— 冷启动才恢复,
  同一会话切回首页 tab / 宿主 ?t= 重载都不会再跳;replace 不留 history、back 不会来回弹
- 宫格 / 工具卡 / 宝宝来信 / 孕检日历入口补 identifier,便于服务端在架校验
- 抽出 withIdentity(),jumpApp 行为不变(身份仍走 query,不追加 hash)
- 版本 v26092009 → v26092201
This commit is contained in:
2026-09-22 05:11:24 +08:00
parent 3b70f63dce
commit 8c6b18c5e1
2 changed files with 90 additions and 13 deletions

View File

@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title>
<!-- V:26092009 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<!-- V:26092201 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css">
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 共享助手:授权/跳商城/位置上报(分享卡片同步,见 docs/h5-auth-standard.md 第四节) -->