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

View File

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