From 0d75716a29b8e45a194f7e72aee2e8d86f372ddd Mon Sep 17 00:00:00 2001 From: ShuaiKang Zhang Date: Wed, 4 Dec 2019 17:54:31 +0800 Subject: [PATCH] fix(Popup): compatible_safe_bottom_in_iphone11 (#2465) --- packages/mixins/safe-area.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mixins/safe-area.ts b/packages/mixins/safe-area.ts index 7d42ec18..34858f96 100644 --- a/packages/mixins/safe-area.ts +++ b/packages/mixins/safe-area.ts @@ -6,12 +6,12 @@ function getSafeArea() { resolve(cache); } else { wx.getSystemInfo({ - success: ({ model, screenHeight, statusBarHeight }) => { - const iphoneX = /iphone x/i.test(model); - const iphoneNew = /iPhone11/i.test(model) && screenHeight === 812; + success: ({ model, statusBarHeight }) => { + const deviceType = model.replace(/\s/g, '-'); + const iphoneNew = /iphone-x|iPhone11|iPhone12/i.test(deviceType); cache = { - isIPhoneX: iphoneX || iphoneNew, + isIPhoneX: iphoneNew, statusBarHeight };