SortList.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="list-row" :style="`min-height: calc(100vh - ${barHeight}px - ${top || 0})`">
  3. <slot></slot>
  4. <van-empty :image="emptyImg" :description="emptyText" v-if="empty">
  5. <div class="empty-button">
  6. <slot name="emptyButton"></slot>
  7. </div>
  8. </van-empty>
  9. <div class="endText" v-else>
  10. <van-loading size="24px" v-if="loading">{{ $t('jia-zai-zhong') }}...</van-loading>
  11. <p v-if="finish">{{ $t('mei-you-geng-duo-le') }}</p>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import { mapState } from 'vuex';
  17. export default {
  18. props: {
  19. empty: {
  20. type: Boolean,
  21. default: false
  22. },
  23. loading: {
  24. type: Boolean,
  25. default: false
  26. },
  27. finish: {
  28. type: Boolean,
  29. default: false
  30. },
  31. top: {
  32. type: String,
  33. default: ''
  34. },
  35. emptyImg: {
  36. type: String,
  37. default: 'http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/kong_img_default.png'
  38. },
  39. emptyText: {
  40. type: String,
  41. default: () => {
  42. return this.$t('jing-qing-qi-dai');
  43. }
  44. }
  45. },
  46. computed: {
  47. ...mapState(['barTop', 'barHeight'])
  48. },
  49. data() {
  50. return {};
  51. },
  52. onShow() {}
  53. };
  54. </script>
  55. <style lang="less">
  56. page {
  57. padding-bottom: 0px;
  58. }
  59. .list-row {
  60. background: @bg;
  61. padding: 6px 0 50px;
  62. box-sizing: border-box;
  63. .van-empty__image {
  64. width: 240px;
  65. height: 240px;
  66. }
  67. .van-empty__description {
  68. font-size: 12px;
  69. color: #bcc1cc;
  70. line-height: 17px;
  71. margin-top: 8px;
  72. }
  73. }
  74. .endText {
  75. display: flex;
  76. justify-content: center;
  77. }
  78. .empty-button {
  79. margin-top: 16px;
  80. width: 240px;
  81. }
  82. </style>