index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="loading-container" :class="loading ? 'show' : 'hide'">
  3. <view class="loading-wrapper">
  4. <image class="loading-logo" src="https://onlinecatelogue.productronicachina.com.cn/assets/image/normal-logo.jpg" mode="aspectFit" />
  5. <view class="loader"></view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import vanLoading from '@/wxcomponents/vant/loading/index'
  11. import vanOverlay from '@/wxcomponents/vant/overlay/index'
  12. export default {
  13. props: {
  14. loading: Boolean
  15. },
  16. components: {
  17. vanLoading,
  18. vanOverlay
  19. },
  20. data() {
  21. return {
  22. show: false
  23. };
  24. }
  25. }
  26. </script>
  27. <style lang="scss">
  28. .loading-container {
  29. z-index: 99999;
  30. background-color: #ffffff;
  31. height: 100%;
  32. left: 0;
  33. position: fixed;
  34. top: 0;
  35. width: 100%;
  36. transition: .3s ease-in-out;
  37. //transform: scale(0.1);
  38. &.show {
  39. opacity: 1;
  40. //transform: scale(1);
  41. }
  42. &.hide {
  43. transition-delay: .5s;
  44. opacity: 0;
  45. //transform: scale(0.1);
  46. z-index: -99999;
  47. }
  48. .loader {
  49. width: calc(350rpx / 0.707);
  50. height: 28rpx;
  51. background: repeating-linear-gradient(-45deg, $buttonPrimaryColor 0 30rpx,#0000 0 40rpx) left/200% 100%;
  52. animation: i3 2.5s infinite linear;
  53. border-radius: 10rpx;
  54. border: 1rpx solid $buttonPrimaryColor;
  55. }
  56. @keyframes i3 {
  57. 100% {
  58. background-position: right
  59. }
  60. }
  61. /*.loader {
  62. display: block;
  63. --height-of-loader: 4px;
  64. --loader-color: #0071e2;
  65. width: 130px;
  66. height: var(--height-of-loader);
  67. border-radius: 30px;
  68. background-color: rgba(0,0,0,0.2);
  69. position: relative;
  70. }
  71. .loader::before {
  72. content: "";
  73. position: absolute;
  74. background: var(--loader-color);
  75. top: 0;
  76. left: 0;
  77. width: 0%;
  78. height: 100%;
  79. border-radius: 30px;
  80. animation: moving 1s ease-in-out infinite;
  81. ;
  82. }
  83. @keyframes moving {
  84. 50% {
  85. width: 100%;
  86. }
  87. 100% {
  88. width: 0;
  89. right: 0;
  90. left: unset;
  91. }
  92. }*/
  93. }
  94. .van-overlay {
  95. background-color: #ffffff;
  96. }
  97. .loading-wrapper {
  98. //height: 100vh;
  99. width: 100%;
  100. height: 100%;
  101. align-items: center;
  102. justify-content: center;
  103. display: flex;
  104. flex-direction: column;
  105. .loading-logo {
  106. height: 160px;
  107. width: 160px;
  108. }
  109. }
  110. </style>