feat(privacy): add markSkipped method and H5 skip logic for privacy popup
add markSkipped method to synchronously skip privacy popup, and call it in App.vue created hook for H5 environment when current URL matches skip condition
This commit is contained in:
10
App.vue
10
App.vue
@@ -51,6 +51,16 @@
|
||||
$langReady: Promise.resolve({ ok: true, source: 'local' })
|
||||
};
|
||||
},
|
||||
// 同步钩子:在 page mounted 之前同步设置隐私弹窗的 skip 状态
|
||||
// 必须在 onLaunch (async) 之前跑,否则 onLaunch 第一个 await 让出事件循环时
|
||||
// privacy-popup.vue 已经挂载,会走 consumePendingShow 兜底分支把弹窗弹出来
|
||||
created() {
|
||||
// #ifdef H5
|
||||
if (_shouldSkipPrivacyForCurrentUrl()) {
|
||||
PrivacyManager.markSkipped()
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
onLaunch: async function(options) {
|
||||
// ============================================================
|
||||
// 主题提前加载(关键):让首屏渲染前 CSS 变量已挂上,避免闪一下
|
||||
|
||||
Reference in New Issue
Block a user