const app = getApp() Page({ data: { isIphoneX:false, }, onLoad: function () { this.setData({ "isIphoneX": this.isIphoneX() }) }, isIphoneX() { let mobile = wx.getSystemInfoSync(); if (mobile.model.indexOf("iPhone X") >= 0) { return true; } else { return false; } } })
<view class='btn' style='padding-bottom:{{ isIphoneX ? 68 : 0 }}rpx;'>固定底部</view>