Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支付宝小程序底部安全边距iPX方案 #34

Open
aototo opened this issue Nov 10, 2020 · 0 comments
Open

支付宝小程序底部安全边距iPX方案 #34

aototo opened this issue Nov 10, 2020 · 0 comments

Comments

@aototo
Copy link
Owner

aototo commented Nov 10, 2020

手机型号 支付宝的版本标识
iPhone X iPhone10,3 / iPhone10,6
iPhone XR iPhone11,8
iPhone XS iPhone11,2
iPhone 11 iPhone12,1
iPhone 11 Pro iPhone12,3
iPhone XS Max iPhone11,6 / iPhone11,4
iPhone 11 Pro Max iPhone12,5
iPhone 12 iPhone13,2
iPhone 12 Pro iPhone 13,3

解决方案
通过 my.getSystemInfo 获取设备信息,可以获取最新的一个 isIphoneXSeries 来确定是否是X系列

const sysInfo = getSystemInfoSync()
if (sysInfo.isIphoneXSeries === true) {
	isIpx = true
}

方案二
目前更新的IPhone 12,在sysInfo.model: iPhone13,2, iPhone13,3(真是奇怪,居然这样的命名)

const sysInfo = getSystemInfoSync()

if ([
    'iPhone10,3',
    'iPhone10,6',
    'iPhone11,8',
    'iPhone11,2',
    'iPhone12,1',
    'iPhone12,3',
    'iPhone11,6',
    'iPhone11,4',
    'iPhone12,5',
    'iPhone13,2',
    'iPhone13,3',
  ].includes(sysInfo.model)) {
    isIpx = true
  }
}

推荐使用 方案一,但二的方案也要在具体的代码里面做兼容操作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant