index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="bottom_tips_content">
  3. <view class="line_inner_row" :class="[ loading ? 'is_loading' : '' ]">
  4. <view class="text_box">
  5. <view
  6. v-for="(item, index) in type === 0 ? onBottomText : loadingText" :key="index" class="text_item"
  7. :class="[loading ? 'text_loading' : '', `delay-${index % 10}`]"
  8. >
  9. {{ item }}
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'ListBottomTips',
  18. props: {
  19. loadingText: {
  20. type: String,
  21. default: '加载中...'
  22. },
  23. onBottomText: {
  24. type: String,
  25. default: '已经到达底部了~'
  26. },
  27. type: {
  28. type: Number,
  29. default: 0 // 0底部1加载
  30. },
  31. loading: {
  32. type: Boolean,
  33. default: true
  34. }
  35. },
  36. data() {
  37. return {}
  38. },
  39. methods: {}
  40. }
  41. </script>
  42. <style
  43. lang="scss"
  44. scoped
  45. >
  46. .bottom_tips_content {
  47. padding: 20rpx 30rpx;
  48. box-sizing: border-box;
  49. .line_inner_row {
  50. width: 100%;
  51. position: relative;
  52. display: flex;
  53. align-items: center;
  54. justify-content: space-around;
  55. font-weight: bold;
  56. .text_box {
  57. display: flex;
  58. .text_item {
  59. animation-delay: calc(.1s * var(--jumpTime))
  60. }
  61. .delay-0 {
  62. animation-delay: calc(0s)
  63. }
  64. .delay-1 {
  65. animation-delay: calc(.1s)
  66. }
  67. .delay-2 {
  68. animation-delay: calc(.2s)
  69. }
  70. .delay-3 {
  71. animation-delay: calc(.3s)
  72. }
  73. .delay-4 {
  74. animation-delay: calc(.4s)
  75. }
  76. .delay-5 {
  77. animation-delay: calc(.5s)
  78. }
  79. .delay-6 {
  80. animation-delay: calc(.6s)
  81. }
  82. .delay-7 {
  83. animation-delay: calc(.7s)
  84. }
  85. .delay-8 {
  86. animation-delay: calc(.8s)
  87. }
  88. .delay-9 {
  89. animation-delay: calc(.9s)
  90. }
  91. }
  92. &:before,
  93. &:after {
  94. flex-shrink: 0;
  95. flex-grow: 0;
  96. content: '';
  97. width: 20%;
  98. height: 5rpx;
  99. border-radius: 8rpx;
  100. background-color: #898989;
  101. }
  102. }
  103. .is_loading {
  104. animation: breathe 1s ease-in-out 0s infinite alternate;
  105. }
  106. .text_loading {
  107. animation: jump 2s ease-in-out infinite;
  108. }
  109. }
  110. @keyframes breathe {
  111. from {
  112. opacity: 1;
  113. }
  114. to {
  115. opacity: .5;
  116. }
  117. }
  118. @keyframes jump {
  119. 30% {
  120. transform: translateY(-12rpx)
  121. }
  122. 60% {
  123. transform: translateY(12rpx)
  124. }
  125. 0%,
  126. 100% {
  127. transform: translateY(0rpx)
  128. }
  129. }
  130. </style>