子页面恢复:脚本加载即判断,不等 load
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -234,6 +234,8 @@
|
|||||||
return true;
|
return true;
|
||||||
} catch (e) { return false; }
|
} catch (e) { return false; }
|
||||||
}
|
}
|
||||||
|
/* 脚本一加载就判断,不等 init(init 挂在 load 上,要等图片全下完,太晚:用户已经刷新走了、记录还没清;跳转也会先闪首页) */
|
||||||
|
const SUB_GONE = resumeSub();
|
||||||
|
|
||||||
/* 首屏恢复:读一次 last_app,命中就带着当前身份 replace 过去。 */
|
/* 首屏恢复:读一次 last_app,命中就带着当前身份 replace 过去。 */
|
||||||
function resumeLastApp() {
|
function resumeLastApp() {
|
||||||
@@ -3789,7 +3791,7 @@
|
|||||||
clearLastAppOnBackHome(false);
|
clearLastAppOnBackHome(false);
|
||||||
/* 冷启动恢复:读一次 last_app,命中就跳到上次进入的 H5 应用(会话内只尝试一次,
|
/* 冷启动恢复:读一次 last_app,命中就跳到上次进入的 H5 应用(会话内只尝试一次,
|
||||||
见 resumeLastApp)。放在最前面,尽量少闪一下首页。 */
|
见 resumeLastApp)。放在最前面,尽量少闪一下首页。 */
|
||||||
if (!resumeSub()) resumeLastApp();
|
if (!SUB_GONE) resumeLastApp();
|
||||||
/* 首屏向小程序宿主上报当前位置:宿主据此解析分享卡片(见 reportHostLocation 说明)。 */
|
/* 首屏向小程序宿主上报当前位置:宿主据此解析分享卡片(见 reportHostLocation 说明)。 */
|
||||||
if (window.wxAuth && window.wxAuth.reportLocation) window.wxAuth.reportLocation();
|
if (window.wxAuth && window.wxAuth.reportLocation) window.wxAuth.reportLocation();
|
||||||
/* 默认预产期是「今天 + 3 个月」现算出来的,标记里那些
|
/* 默认预产期是「今天 + 3 个月」现算出来的,标记里那些
|
||||||
|
|||||||
Reference in New Issue
Block a user