load.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="window-box">
  3. <view class="dis-flex flex-dir-column flex-x-center flex-y-center">
  4. <view class="logo">
  5. <image class="logo-image" src="/static/logo.png"/>
  6. </view>
  7. <view class="m-t-20 f-w-b p-b-50">{{ pD.name }}</view>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. import {getCurrentInstance, inject, onActivated, onBeforeUnmount, onMounted, reactive, ref} from "vue";
  13. import {onShow, onHide} from "@dcloudio/uni-app";
  14. import {checkLogin, redirectTo} from "@/utils/app";
  15. const pD = reactive({
  16. name: '体训助手',
  17. })
  18. // 挂载完成之后
  19. onMounted(async (r) => {
  20. setTimeout(() => {
  21. let a = checkLogin(true)
  22. if (!a) {
  23. redirectTo('pages/index/init')
  24. } else {
  25. redirectTo('pages/index/index')
  26. }
  27. }, 2000)
  28. })
  29. // 激活页面时
  30. onActivated(async () => {
  31. })
  32. </script>
  33. <style lang="scss" scoped>
  34. .window-box {
  35. background-color: #006bff;
  36. background-size: 100% auto;
  37. background-repeat: no-repeat;
  38. width: 100vw;
  39. height: 100vh;
  40. color: #fff;
  41. font-size: 43upx;
  42. display: flex;
  43. justify-content: center;
  44. align-items: center;
  45. .logo {
  46. width: 140upx;
  47. height: 140upx;
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. background: #cccccc50;
  52. border-radius: 50%;
  53. &-image {
  54. width: 90%;
  55. height: 90%;
  56. border-radius: 50%;
  57. }
  58. }
  59. }
  60. </style>