jiangping
2024-07-10 0cd9447ee893a8490488aca6a6a073b040fcd7f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// app.js
App({
  globalData: {
    primary: '#B08771',
    bottomLift: ''
  },
  onLaunch: function () {
    //获取当前设备信息
    const WindowInfo = wx.getWindowInfo()
    console.log('WindowInfo', WindowInfo);
    if (WindowInfo.safeArea.top > 20) {
      this.globalData.bottomLift = WindowInfo.screenHeight - WindowInfo.safeArea.bottom;
      console.log(this.globalData.bottomLift);
    }
  }
})