loading.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="box">
  3. <image class="img" src="https://minio.menduner.com/dev/fe9890be9b1176f84f2aa282b0f6adce300b133f65eb3d7b45ae057aa5698324.png"></image>
  4. <view class="color-primary font-size-20 font-weight-bold">门墩儿 专注顶尖招聘</view>
  5. <view class="icons">
  6. <uni-icons type="spinner-cycle" size="24" />
  7. </view>
  8. </view>
  9. </template>
  10. <script setup>
  11. import { onShow } from '@dcloudio/uni-app'
  12. import { getAccessToken } from '@/utils/request'
  13. import { showAuthModal } from '@/hooks/useModal'
  14. import { userStore } from '@/store/user'
  15. const useUserStore = userStore()
  16. const tabBarControl = (show = false) => { // 显示/隐藏 TabBar
  17. const currentPage = getCurrentPages()
  18. if (!currentPage) return
  19. const currentTabBar = currentPage[0]?.getTabBar?.()
  20. currentTabBar?.setData({ show })
  21. }
  22. onShow(async() => {
  23. tabBarControl(false) // 隐藏页面底部导航
  24. // 检查是否是个人令牌
  25. if (getAccessToken() && uni.getStorageSync('isPersonalToken')) {
  26. // 查看用户是否有在申请中的数据
  27. const { code } = await useUserStore.getPersonalApplyingData()
  28. uni.redirectTo({ url: code ? '/pages/register/review?hasData=true' : '/pages/register/index' })
  29. return
  30. }
  31. if (!getAccessToken()) showAuthModal()
  32. uni.reLaunch({ url: '/pages/index/search' }) // 进入门墩儿
  33. })
  34. </script>
  35. <style lang="scss" scoped>
  36. .box {
  37. text-align: center;
  38. .img {
  39. width: 105px;
  40. height: 45px;
  41. margin-top: 30vh;
  42. margin-bottom: 16px;
  43. }
  44. .icons {
  45. position: fixed;
  46. bottom: 20vh;
  47. width: 100%;
  48. margin: 0 auto;
  49. }
  50. }
  51. </style>