<script lang="ts" setup>
import {useConfigStore} from "@/store";

const configStore = useConfigStore()

function getSystemInfo(): any {
  let systemInfo: any
  // #ifdef MP-WEIXIN
  try {
    // const systemSetting = uni.getSystemSetting() // 暂时不需要
    const deviceInfo = uni.getDeviceInfo()
    const windowInfo = uni.getWindowInfo()
    const appBaseInfo = uni.getAppBaseInfo()
    systemInfo = {
      ...deviceInfo,
      ...windowInfo,
      ...appBaseInfo
    }
  } catch (error) {
    console.warn('获取系统信息失败，降级使用uni.getSystemInfoSync:', error)
    // 降级处理，使用原来的方法
    systemInfo = uni.getSystemInfoSync()
  }
  // #endif
  // #ifndef MP-WEIXIN
  systemInfo = uni.getSystemInfoSync()
  // #endif
  return systemInfo
}

const { statusBarHeight } = getSystemInfo()
</script>

<template>
  <view :style="[{ height: statusBarHeight + 'px' }]" class="w-750rpx shrink-0"></view>
</template>

<style lang="scss" scoped>

</style>
