loading.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. const tabBarControl = (show = false) => { // 显示/隐藏 TabBar
  15. console.log('TabBar:', show ? '展示' : '隐藏')
  16. const currentPage = getCurrentPages()
  17. if (!currentPage) return
  18. const currentTabBar = currentPage[0]?.getTabBar?.()
  19. currentTabBar?.setData({ show })
  20. }
  21. onShow(() => {
  22. tabBarControl(false) // 隐藏页面底部导航
  23. // 检查是否是个人令牌
  24. if (getAccessToken() && uni.getStorageSync('isPersonalToken')) {
  25. const url = uni.getStorageSync('entRegisterData') ? '/pages/register/review?hasData=true' : '/pages/register/index'
  26. uni.redirectTo({ url })
  27. return
  28. }
  29. if (!getAccessToken()) showAuthModal()
  30. uni.reLaunch({ url: '/pages/index/search' }) // 进入门墩儿
  31. })
  32. </script>
  33. <style lang="scss" scoped>
  34. .box {
  35. text-align: center;
  36. .img {
  37. width: 105px;
  38. height: 45px;
  39. margin-top: 30vh;
  40. margin-bottom: 16px;
  41. }
  42. .icons {
  43. position: fixed;
  44. bottom: 20vh;
  45. width: 100%;
  46. margin: 0 auto;
  47. }
  48. }
  49. </style>