welcome.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="wrapper">
  3. <view class="circle"></view>
  4. <view class="circle"></view>
  5. <view class="circle"></view>
  6. <view class="shadow"></view>
  7. <view class="shadow"></view>
  8. <view class="shadow"></view>
  9. <text>加载中...</text>
  10. </view>
  11. </template>
  12. <script setup>
  13. import { onLoad } from '@dcloudio/uni-app'
  14. import { useUserStore } from '@/stores/user'
  15. const user = useUserStore()
  16. onLoad(() => {
  17. // 静默登录
  18. // user.loginByCode().finally(() => {
  19. // uni.switchTab({
  20. // url: '/pages/index/index'
  21. // })
  22. // })
  23. uni.switchTab({
  24. url: '/pages/index/index'
  25. })
  26. })
  27. </script>
  28. <style>
  29. page {
  30. background-color: #fff;
  31. }
  32. </style>
  33. <style lang="scss" scoped>
  34. .wrapper {
  35. width: 200px;
  36. height: 60px;
  37. position: absolute;
  38. left: 50%;
  39. top: 50%;
  40. transform: translate(-50%, -50%);
  41. }
  42. .circle {
  43. width: 20px;
  44. height: 20px;
  45. position: absolute;
  46. border-radius: 50%;
  47. background-color: var(--primary);
  48. left: 15%;
  49. transform-origin: 50%;
  50. animation: circle 0.5s alternate infinite ease;
  51. }
  52. @keyframes circle {
  53. 0% {
  54. top: 60px;
  55. height: 5px;
  56. border-radius: 50px 50px 25px 25px;
  57. transform: scaleX(1.7);
  58. }
  59. 40% {
  60. height: 20px;
  61. border-radius: 50%;
  62. transform: scaleX(1);
  63. }
  64. 100% {
  65. top: 0%;
  66. }
  67. }
  68. .circle:nth-child(2) {
  69. left: 45%;
  70. animation-delay: 0.2s;
  71. }
  72. .circle:nth-child(3) {
  73. left: auto;
  74. right: 15%;
  75. animation-delay: 0.3s;
  76. }
  77. .shadow {
  78. width: 20px;
  79. height: 4px;
  80. border-radius: 50%;
  81. background-color: rgba(0, 0, 0, 0.5);
  82. position: absolute;
  83. top: 62px;
  84. transform-origin: 50%;
  85. z-index: -1;
  86. left: 15%;
  87. filter: blur(1px);
  88. animation: shadow 0.5s alternate infinite ease;
  89. }
  90. @keyframes shadow {
  91. 0% {
  92. transform: scaleX(1.5);
  93. }
  94. 40% {
  95. transform: scaleX(1);
  96. opacity: 0.7;
  97. }
  98. 100% {
  99. transform: scaleX(0.2);
  100. opacity: 0.4;
  101. }
  102. }
  103. .shadow:nth-child(4) {
  104. left: 45%;
  105. animation-delay: 0.2s;
  106. }
  107. .shadow:nth-child(5) {
  108. left: auto;
  109. right: 15%;
  110. animation-delay: 0.3s;
  111. }
  112. text {
  113. position: absolute;
  114. top: 75px;
  115. font-family: 'Lato';
  116. font-size: 18px;
  117. letter-spacing: 12px;
  118. color: var(--primary);
  119. left: 15%;
  120. }
  121. </style>