fuint-uniapp-master/components/mixins/iphonex.js

(完整代码) 867B

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 });
        });
    }
});

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。