home.vue 926 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view id="home">
  3. <safety-examine-home></safety-examine-home>
  4. </view>
  5. </template>
  6. <script>
  7. import { safetyExamineHome} from '@/pages/safetyExamineWorkbench.vue'
  8. import { tabBar } from '@/component/tabBar.vue'
  9. export default {
  10. name: "home",
  11. components: {
  12. tabBar,
  13. safetyExamineHome
  14. },
  15. data() {
  16. return {
  17. userType:0,
  18. }
  19. },
  20. onLoad() {
  21. },
  22. onShow(){
  23. if(uni.getStorageSync('token')&&uni.getStorageSync('userId')&&uni.getStorageSync('userType')){
  24. this.userType = uni.getStorageSync('userType')
  25. }else{
  26. uni.removeStorageSync('token');
  27. uni.removeStorageSync('userId');
  28. uni.removeStorageSync('userType');
  29. uni.redirectTo({
  30. url: '/pages/login',
  31. });
  32. }
  33. },
  34. methods: {
  35. },
  36. onHide(){
  37. this.userType = 0;
  38. },
  39. onUnload(){
  40. this.userType = 0;
  41. }
  42. }
  43. </script>
  44. <style lang="stylus" scoped>
  45. #home{
  46. height:100%;
  47. }
  48. </style>