This commit is contained in:
砂糖
2026-02-07 18:01:13 +08:00
commit 8015759c65
2110 changed files with 269866 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
let isIPhoneX = null;
function getIsIPhoneX() {
return new Promise((resolve, reject) => {
if (isIPhoneX !== null) {
resolve(isIPhoneX);
}
else {
wx.getSystemInfo({
success: ({ model, screenHeight }) => {
const iphoneX = /iphone x/i.test(model);
const iphoneNew = /iPhone11/i.test(model) && screenHeight === 812;
isIPhoneX = iphoneX || iphoneNew;
resolve(isIPhoneX);
},
fail: reject
});
}
});
}
export const iphonex = Behavior({
properties: {
safeAreaInsetBottom: {
type: Boolean,
value: true
}
},
created() {
getIsIPhoneX().then(isIPhoneX => {
this.set({ isIPhoneX });
});
}
});