微信小程序 判断是否是全面屏手机和机型

2021-10-12  本文已影响0人  奋斗吧灬青年
        let _this = this;
        
        // 获取手机系统信息
        wx.getSystemInfo({
            success: res => {
 
                // 根据 屏幕高度 进行判断
                if (res.screenHeight - res.windowHeight - res.statusBarHeight - 32 > 72) {
                    _this.globalData.isFullSucreen = true
                }
                // 根据手机类型
                if (res.platform =="ios") {
                    _this.globalData.iOSDevice = true
                }
 
            },
            fail(err) {
 
            }
        })
上一篇 下一篇

猜你喜欢

热点阅读