<template>
  <view id="home">
    <safety-examine-home></safety-examine-home>
  </view>
</template>
<script>
import { manageHome } from '@/pages/manageWorkbench'
import { userHome } from '@/pages/studentWorkbench.vue'
import { supplierHome } from '@/pages/supplierWorkbench.vue'
import { safetyExamineHome} from '@/pages/safetyExamineWorkbench.vue'
import { tabBar } from '@/component/tabBar.vue'
export default {
  name: "home",
  components: {
    manageHome,
    userHome,
    supplierHome,
    tabBar,
	safetyExamineHome
  },
  data() {
    return {
      userType:0,
    }
  },
  onLoad() {

  },
  onShow(){
    if(uni.getStorageSync('token')&&uni.getStorageSync('userId')&&uni.getStorageSync('userType')){
      this.userType = uni.getStorageSync('userType')
    }else{
      uni.removeStorageSync('token');
      uni.removeStorageSync('userId');
      uni.removeStorageSync('userType');
      uni.redirectTo({
        url: '/pages/login',
      });
    }
  },
  methods: {

  },
  onHide(){
    this.userType = 0;
  },
  onUnload(){
    this.userType = 0;
  }
}
</script>

<style lang="stylus" scoped>
#home{
  height:100%;
}
</style>
