chore: common/js/util.js 增加判断是快应用的函数

This commit is contained in:
2026-01-08 09:04:36 +08:00
parent faf1f6d3d8
commit 6718010ceb
2 changed files with 9 additions and 3 deletions

View File

@@ -1168,8 +1168,12 @@ export default {
* @returns {boolean} 是否为快应用
*/
isQuickApp() {
// #ifndef QUICKAPP-WEBVIEW
const systemInfo = this.getDeviceInfo();
return systemInfo.platform === 'quickapp' || process.env.UNI_PLATFORM === 'quickapp';
// #endif
return true;
},
/**
* 判断是否为华为快应用环境
@@ -1177,8 +1181,12 @@ export default {
*/
isHuaweiQuickApp() {
if (!this.isQuickApp()) return false;
// #ifndef QUICKAPP-WEBVIEW-HUAWEI
const systemInfo = this.getDeviceInfo();
return systemInfo.brand === 'HUAWEI' || systemInfo.manufacturer === 'HUAWEI' ||
(typeof qh !== 'undefined' && qh.platform === 'huawei');
// #endif
return true;
}
}

View File

@@ -137,10 +137,8 @@
</uni-popup>
</view>
<hover-nav :need="true"></hover-nav>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<!-- 隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
<ns-login ref="login"></ns-login>
</view>