oa-load-more.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="oa-load-more" :style="{width: width}">
  3. <view class="oa-load-more__img" v-if="status === 'loading' && showIcon">
  4. <view class="load1">
  5. <view :style="{ background: color }"></view>
  6. <view :style="{ background: color }"></view>
  7. <view :style="{ background: color }"></view>
  8. <view :style="{ background: color }"></view>
  9. </view>
  10. <view class="load2">
  11. <view :style="{ background: color }"></view>
  12. <view :style="{ background: color }"></view>
  13. <view :style="{ background: color }"></view>
  14. <view :style="{ background: color }"></view>
  15. </view>
  16. <view class="load3">
  17. <view :style="{ background: color }"></view>
  18. <view :style="{ background: color }"></view>
  19. <view :style="{ background: color }"></view>
  20. <view :style="{ background: color }"></view>
  21. </view>
  22. </view>
  23. <view
  24. class="cu-load"
  25. :class="status === 'more' ? 'loading' : 'over'"
  26. ></view>
  27. <!--<text class="oa-load-more__text" :style="{color:color}">{{status === 'more' ? contentText.contentdown : (status === 'loading' ? contentText.contentrefresh : contentText.contentnomore)}}</text>-->
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'oa-load-more',
  33. props: {
  34. status: {
  35. // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
  36. type: String,
  37. default: 'more'
  38. },
  39. width: {
  40. // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
  41. type: String,
  42. default: '100vw'
  43. },
  44. showIcon: {
  45. type: Boolean,
  46. default: true
  47. },
  48. color: {
  49. type: String,
  50. default: '#777777'
  51. },
  52. contentText: {
  53. type: Object,
  54. default() {
  55. return {
  56. // contentdown: "上拉显示更多",
  57. // contentrefresh: "正在加载...",
  58. // contentnomore: "—— 全部都被您看完了 ——"
  59. };
  60. }
  61. }
  62. },
  63. data() {
  64. return {};
  65. }
  66. };
  67. </script>
  68. <style>
  69. .oa-load-more {
  70. display: flex;
  71. flex-direction: row;
  72. height: 80upx;
  73. align-items: center;
  74. justify-content: center;
  75. /*position: fixed;*/
  76. /*bottom: 5upx;*/
  77. /*text-align: center;*/
  78. }
  79. .oa-load-more__text {
  80. font-size: 28upx;
  81. color: #999;
  82. }
  83. .oa-load-more__img {
  84. height: 24px;
  85. width: 24px;
  86. margin-right: 10px;
  87. }
  88. .oa-load-more__img > view {
  89. position: absolute;
  90. }
  91. .oa-load-more__img > view view {
  92. width: 6px;
  93. height: 2px;
  94. border-top-left-radius: 1px;
  95. border-bottom-left-radius: 1px;
  96. background: #999;
  97. position: absolute;
  98. opacity: 0.2;
  99. transform-origin: 50%;
  100. animation: load 1.56s ease infinite;
  101. }
  102. .oa-load-more__img > view view:nth-child(1) {
  103. transform: rotate(90deg);
  104. top: 2px;
  105. left: 9px;
  106. }
  107. .oa-load-more__img > view view:nth-child(2) {
  108. transform: rotate(180deg);
  109. top: 11px;
  110. right: 0;
  111. }
  112. .oa-load-more__img > view view:nth-child(3) {
  113. transform: rotate(270deg);
  114. bottom: 2px;
  115. left: 9px;
  116. }
  117. .oa-load-more__img > view view:nth-child(4) {
  118. top: 11px;
  119. left: 0;
  120. }
  121. .load1,
  122. .load2,
  123. .load3 {
  124. height: 24px;
  125. width: 24px;
  126. }
  127. .load2 {
  128. transform: rotate(30deg);
  129. }
  130. .load3 {
  131. transform: rotate(60deg);
  132. }
  133. .load1 view:nth-child(1) {
  134. animation-delay: 0s;
  135. }
  136. .load2 view:nth-child(1) {
  137. animation-delay: 0.13s;
  138. }
  139. .load3 view:nth-child(1) {
  140. animation-delay: 0.26s;
  141. }
  142. .load1 view:nth-child(2) {
  143. animation-delay: 0.39s;
  144. }
  145. .load2 view:nth-child(2) {
  146. animation-delay: 0.52s;
  147. }
  148. .load3 view:nth-child(2) {
  149. animation-delay: 0.65s;
  150. }
  151. .load1 view:nth-child(3) {
  152. animation-delay: 0.78s;
  153. }
  154. .load2 view:nth-child(3) {
  155. animation-delay: 0.91s;
  156. }
  157. .load3 view:nth-child(3) {
  158. animation-delay: 1.04s;
  159. }
  160. .load1 view:nth-child(4) {
  161. animation-delay: 1.17s;
  162. }
  163. .load2 view:nth-child(4) {
  164. animation-delay: 1.3s;
  165. }
  166. .load3 view:nth-child(4) {
  167. animation-delay: 1.43s;
  168. }
  169. @-webkit-keyframes load {
  170. 0% {
  171. opacity: 1;
  172. }
  173. 100% {
  174. opacity: 0.2;
  175. }
  176. }
  177. </style>