From faf1f6d3d8cbac826d1312a1a130124a6b17e839 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Wed, 7 Jan 2026 18:28:51 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=BF=AB=E5=BA=94=E7=94=A8=E7=8E=AF=E5=A2=83=E7=9A=84?= =?UTF-8?q?API=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/util.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/js/util.js b/common/js/util.js index 9829e01..56519f4 100644 --- a/common/js/util.js +++ b/common/js/util.js @@ -1162,5 +1162,23 @@ export default { verifyMobile(mobile) { var parse = /^\d{11}$/.test(mobile); return parse; + }, + /** + * 判断是否为快应用环境 + * @returns {boolean} 是否为快应用 + */ + isQuickApp() { + const systemInfo = this.getDeviceInfo(); + return systemInfo.platform === 'quickapp' || process.env.UNI_PLATFORM === 'quickapp'; + }, + /** + * 判断是否为华为快应用环境 + * @returns {boolean} 是否为华为快应用 + */ + isHuaweiQuickApp() { + if (!this.isQuickApp()) return false; + const systemInfo = this.getDeviceInfo(); + return systemInfo.brand === 'HUAWEI' || systemInfo.manufacturer === 'HUAWEI' || + (typeof qh !== 'undefined' && qh.platform === 'huawei'); } } \ No newline at end of file