fix: 解决在快应用环境中不显示用户隐私提示窗体的问题

This commit is contained in:
2026-01-08 14:52:01 +08:00
parent ee4fbb277c
commit 5a8663eb48
4 changed files with 72 additions and 30 deletions

View File

@@ -1169,8 +1169,24 @@ export default {
*/
isQuickApp() {
// #ifndef QUICKAPP-WEBVIEW
const systemInfo = this.getDeviceInfo();
return systemInfo.platform === 'quickapp' || process.env.UNI_PLATFORM === 'quickapp';
let _isQuickApp = false;
try {
const ua = navigator?.userAgent?.toLowerCase();
console.log('ua = ', ua);
_isQuickApp = ua.indexOf('quickapp') !== -1;
if (!_isQuickApp) {
// 特殊说明由于网站是嵌入到快应用的Webview组件中<web>UA中不会包含quickapp字符串
// 但是会包含uniacid参数所以这里通过uniacid参数来判断是否为快应用环境
_isQuickApp = ua.indexOf('uniacid=') !== -1;
}
} catch (e) {}
if (!_isQuickApp) {
const systemInfo = this.getDeviceInfo();
_isQuickApp = systemInfo?.platform === 'quickapp' || process?.env?.UNI_PLATFORM === 'quickapp';
}
return _isQuickApp;
// #endif
return true;