tui-loadmore.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="tui-loadmore">
  3. <view :class="['tui-loading-'+index, (index==3 && type)?'tui-loading-'+type:'']" :style="{color: fontColor}"></view>
  4. <view class="tui-loadmore-tips" :style="{color: fontColor}">{{text}}</view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: "tuiLoadmore",
  10. props: {
  11. //显示文本
  12. text: {
  13. type: String,
  14. default: "正在加载..."
  15. },
  16. //loading 样式 :1,2,3
  17. index: {
  18. type: Number,
  19. default: 1
  20. },
  21. //颜色设置,只有index=3时生效:primary,red,orange,green
  22. type: {
  23. type: String,
  24. default: ""
  25. },
  26. //颜色设置
  27. fontColor: {
  28. type: String,
  29. default: ""
  30. }
  31. }
  32. }
  33. </script>
  34. <style scoped>
  35. .tui-loadmore {
  36. width: 48%;
  37. margin: 1.5em auto;
  38. line-height: 1.5em;
  39. font-size: 24rpx;
  40. text-align: center;
  41. }
  42. .tui-loading-1 {
  43. margin: 0 5px;
  44. width: 20px;
  45. height: 20px;
  46. display: inline-block;
  47. vertical-align: middle;
  48. -webkit-animation: a 1s steps(12) infinite;
  49. animation: a 1s steps(12) infinite;
  50. background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9yb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0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
  51. background-size: 100%;
  52. }
  53. @-webkit-keyframes a {
  54. 0% {
  55. -webkit-transform: rotate(0deg);
  56. transform: rotate(0deg);
  57. }
  58. to {
  59. -webkit-transform: rotate(1turn);
  60. transform: rotate(1turn);
  61. }
  62. }
  63. @keyframes a {
  64. 0% {
  65. -webkit-transform: rotate(0deg);
  66. transform: rotate(0deg);
  67. }
  68. to {
  69. -webkit-transform: rotate(1turn);
  70. transform: rotate(1turn);
  71. }
  72. }
  73. .tui-loadmore-tips {
  74. display: inline-block;
  75. vertical-align: middle;
  76. }
  77. .tui-loading-2 {
  78. width: 28rpx;
  79. height: 28rpx;
  80. border: 1px solid #8f8d8e;
  81. border-radius: 50%;
  82. margin: 0 6px;
  83. display: inline-block;
  84. vertical-align: middle;
  85. clip-path: polygon(0% 0%,100% 0%,100% 30%,0% 30%);
  86. animation: rotate 1s linear infinite;
  87. }
  88. @-webkit-keyframes rotate {
  89. from {
  90. transform: rotatez(0deg);
  91. }
  92. to {
  93. transform: rotatez(360deg);
  94. }
  95. }
  96. @keyframes rotate {
  97. from {
  98. transform: rotatez(0deg);
  99. }
  100. to {
  101. transform: rotatez(360deg);
  102. }
  103. }
  104. .tui-loading-3 {
  105. display: inline-block;
  106. margin: 0 6px;
  107. vertical-align: middle;
  108. width: 28rpx;
  109. height: 28rpx;
  110. background: 0 0;
  111. border-radius: 50%;
  112. border: 2px solid;
  113. border-color: #e5e5e5 #e5e5e5 #e5e5e5 #8f8d8e;
  114. animation: tui-rotate 0.7s linear infinite;
  115. }
  116. .tui-loading-3.tui-loading-primary {
  117. border-color: #e5e5e5 #e5e5e5 #e5e5e5 #5677fc;
  118. }
  119. .tui-loading-3.tui-loading-green {
  120. border-color: #e5e5e5 #e5e5e5 #e5e5e5 #19be6b;
  121. }
  122. .tui-loading-3.tui-loading-orange {
  123. border-color: #e5e5e5 #e5e5e5 #e5e5e5 #ff7900;
  124. }
  125. .tui-loading-3.tui-loading-red {
  126. border-color: #ededed #ededed #ededed #ed3f14;
  127. }
  128. @-webkit-keyframes tui-rotate {
  129. 0% {
  130. transform: rotate(0);
  131. }
  132. 100% {
  133. transform: rotate(360deg);
  134. }
  135. }
  136. @keyframes tui-rotate {
  137. 0% {
  138. transform: rotate(0);
  139. }
  140. 100% {
  141. transform: rotate(360deg);
  142. }
  143. }
  144. </style>