web
2025-07-01 c7f03d9e2748f70455a3c705e0c5a174ced4e115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<template>
    <view class="container" :style="{paddingTop:topHeight + 'rpx'}">
        <view class="content">
            111
        </view>
    </view>
</template>
 
<script setup>
    import { onMounted, ref } from "vue";
    import { BASE_URL } from '../../config/index.js';
    
    const topHeight = ref(0)
    
    // 获取状态栏高度
    function getTopHeight(){
        if(uni.getMenuButtonBoundingClientRect){
            topHeight.value = uni.getMenuButtonBoundingClientRect().bottom * 2
        }
    }
    
    onMounted(() => {
        getTopHeight()
        // if(!uni.getStorageSync('openId') || !uni.getStorageSync('token')){
        //     uni.redirectTo({
        //         url:'/pages/login/index'
        //     })
        // }
    })
</script>
 
<style lang="scss" scoped>
</style>