bayi hace 1 año
padre
commit
62f183449e
Se han modificado 2 ficheros con 9 adiciones y 6 borrados
  1. 7 4
      app.js
  2. 2 2
      project.miniapp.json

+ 7 - 4
app.js

@@ -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() {
         // 获取小程序更新机制兼容

+ 2 - 2
project.miniapp.json

@@ -3,7 +3,7 @@
   "name": "朗读小咖秀",
   "version": "0.0.1",
   "mini-android": {
-    "sdkVersion": "1.1.2",
+    "sdkVersion": "1.1.3",
     "toolkitVersion": "0.10.0",
     "useExtendedSdk": {
       "media": true,
@@ -32,7 +32,7 @@
     }
   },
   "mini-ios": {
-    "sdkVersion": "1.1.4",
+    "sdkVersion": "1.1.6",
     "toolkitVersion": "0.0.9",
     "useExtendedSdk": {
       "WeAppOpenFuns": true,