welcome.vue 2.1 KB

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