Browse Source

抽奖页面

DESKTOP-O04BTUJ\muzen 3 years ago
parent
commit
999b4eb97c
1 changed files with 4 additions and 9 deletions
  1. 4 9
      src/pages/lottery/index.vue

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

@@ -1,6 +1,6 @@
 <template>
 <template>
   <view class="app-container">
   <view class="app-container">
-    <view class="nav" style="margin-top: var(--status-bar-height)">
+    <view class="nav" :style="`margin-top: ${statusBarHeight}`">
       <uni-icons type="back" style="font-size: 48rpx" @click="close" />
       <uni-icons type="back" style="font-size: 48rpx" @click="close" />
       <text class="title">积分抽奖</text>
       <text class="title">积分抽奖</text>
     </view>
     </view>
@@ -49,7 +49,7 @@ export default {
       // 用户信息
       // 用户信息
       userInfo: {},
       userInfo: {},
       // 状态栏高度
       // 状态栏高度
-      statusBarHeight: 0,
+      statusBarHeight: 20,
       // 转盘
       // 转盘
       prizes: [],
       prizes: [],
       buttons: [{
       buttons: [{
@@ -88,13 +88,8 @@ export default {
       this.setUserInfo()
       this.setUserInfo()
     }
     }
   },
   },
-  onReady() {
-    uni.getSystemInfo({
-      success: (res) => {
-        this.statusBarHeight = res.statusBarHeight
-        console.log(res);
-      }
-    })
+  mounted() {
+    this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
   },
   },
   methods: {
   methods: {
     setUserInfo() {
     setUserInfo() {