import { Component } from 'react'
import Taro from '@tarojs/taro'
import './app.less'
import 'taro-ui/dist/style/index.scss'

// 在 App 类外定义全局变量
global.globalData = {
  optionsData: {},  // 存储页面参数
}

class App extends Component {
  state = {
    userInfo: Taro.getStorageSync('userInfo') || {},// 用户信息
  }

  componentDidMount () {
    // 存储导航栏高度
    const systemInfo = Taro.getSystemInfoSync()
    Taro.navigationBarHeight = systemInfo.safeArea.top
  }

  componentDidShow () {}

  componentDidHide () {}

  render () {
    // this.props.children 是将要会渲染的页面
    return this.props.children
  }
}

export default App
