fix(Popup): compatible_safe_bottom_in_iphone11 (#2465)

This commit is contained in:
ShuaiKang Zhang 2019-12-04 17:54:31 +08:00 committed by rex
parent 3562c74d4f
commit 0d75716a29

View File

@ -6,12 +6,12 @@ function getSafeArea() {
resolve(cache); resolve(cache);
} else { } else {
wx.getSystemInfo({ wx.getSystemInfo({
success: ({ model, screenHeight, statusBarHeight }) => { success: ({ model, statusBarHeight }) => {
const iphoneX = /iphone x/i.test(model); const deviceType = model.replace(/\s/g, '-');
const iphoneNew = /iPhone11/i.test(model) && screenHeight === 812; const iphoneNew = /iphone-x|iPhone11|iPhone12/i.test(deviceType);
cache = { cache = {
isIPhoneX: iphoneX || iphoneNew, isIPhoneX: iphoneNew,
statusBarHeight statusBarHeight
}; };