DESKTOP-O04BTUJ\muzen 3 лет назад
Родитель
Сommit
ebabf75f3c
2 измененных файлов с 16 добавлено и 7 удалено
  1. 8 3
      src/pages/lottery/detail.vue
  2. 8 4
      src/pages/lottery/index.vue

+ 8 - 3
src/pages/lottery/detail.vue

@@ -38,9 +38,6 @@ export default {
       disabled: false
     }
   },
-  onReady() {
-    this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
-  },
   onLoad(e) {
     this.form = {
       resultGoodId: e.resultGoodId,
@@ -48,6 +45,14 @@ export default {
     }
     this.userInfo = JSON.parse(e.userInfo)
   },
+  onReady() {
+    uni.getSystemInfo({
+      success: (res) => {
+        this.statusBarHeight = res.statusBarHeight
+        console.log(res);
+      }
+    })
+  },
   methods: {
     // 返回
     getBack() {

+ 8 - 4
src/pages/lottery/index.vue

@@ -79,10 +79,6 @@ export default {
       disabled: true
     }
   },
-  onReady() {
-    this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
-    console.log(uni.getSystemInfoSync());
-  },
   onLoad() {
     // 获取App方法
     getUserInfo.postMessage('获取用户信息')
@@ -92,6 +88,14 @@ export default {
       this.setUserInfo()
     }
   },
+  onReady() {
+    uni.getSystemInfo({
+      success: (res) => {
+        this.statusBarHeight = res.statusBarHeight
+        console.log(res);
+      }
+    })
+  },
   methods: {
     setUserInfo() {
       this.prizes = []