chore: common/js/util.js 增加判断是快应用的函数
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user