|
@@ -16,8 +16,8 @@ App({
|
|
|
async onLaunch() {
|
|
|
// #if MP
|
|
|
this.updateApplet()
|
|
|
- // #endif
|
|
|
this.checkIsIos()
|
|
|
+ // #endif
|
|
|
this.getNavbarInfo()
|
|
|
await loginLog()
|
|
|
},
|
|
@@ -114,9 +114,6 @@ App({
|
|
|
checkIsIos: function () {
|
|
|
wx.getSystemInfo({
|
|
|
success: (res) => {
|
|
|
- // 设备显示区域的宽度,单位px
|
|
|
- this.globalData.windowWidth = res.windowWidth
|
|
|
- this.globalData.windowHeight = res.windowHeight
|
|
|
if (res.system.search('iOS') != -1) {
|
|
|
this.globalData.isIOS = true
|
|
|
}
|
|
@@ -140,6 +137,7 @@ App({
|
|
|
},
|
|
|
// 音箱端登录
|
|
|
deviceLogin() {
|
|
|
+ // #if MP
|
|
|
let {
|
|
|
path,
|
|
|
scene,
|
|
@@ -168,10 +166,12 @@ App({
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ // #endif
|
|
|
},
|
|
|
getNavbarInfo() {
|
|
|
// 获取系统信息
|
|
|
const systemInfo = wx.getSystemInfoSync();
|
|
|
+ console.log(systemInfo);
|
|
|
// 胶囊按钮位置信息
|
|
|
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
|
|
|
// 导航栏高度 = 状态栏高度 + 44
|
|
@@ -179,6 +179,9 @@ App({
|
|
|
this.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
|
|
|
this.globalData.menuTop = menuButtonInfo.top;
|
|
|
this.globalData.menuHeight = menuButtonInfo.height;
|
|
|
+ // 设备显示区域的宽度,单位px
|
|
|
+ this.globalData.windowWidth = systemInfo.windowWidth
|
|
|
+ this.globalData.windowHeight = systemInfo.windowHeight
|
|
|
},
|
|
|
updateApplet() {
|
|
|
// 获取小程序更新机制兼容
|