app-wrapper-empty.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="app-empty">
  3. <div class="app-empty-center">
  4. <div class="app_empty_img">
  5. <image :src="emptyImgUrl" mode="widthFix"></image>
  6. </div>
  7. <div class="app-empty-title">
  8. <span class="empty_noData">{{ title }}</span>
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'AppWrapperEmpty',
  16. props: {
  17. type: {
  18. type: String,
  19. default: 'noData'
  20. },
  21. pictureHeight: {
  22. type: String,
  23. default: ''
  24. },
  25. title: {
  26. type: String,
  27. default: '暂无数据'
  28. },
  29. content: {
  30. type: String,
  31. default: ''
  32. },
  33. isEmpty: {
  34. type: Boolean,
  35. default: false
  36. },
  37. isLoading: {
  38. type: Boolean,
  39. default: false
  40. },
  41. finished: {
  42. type: Boolean,
  43. default: false
  44. },
  45. isTitle: {
  46. type: Boolean,
  47. default: true
  48. }
  49. },
  50. computed: {
  51. /** 空状态图:优先 imgUrl,避免 hostUrl 未配置时路径变成 undefined/... */
  52. emptyImgUrl() {
  53. const imgHost = (this.constant && this.constant.imgUrl) || (this.constant && this.constant.hostUrl) || ''
  54. return `${imgHost}/image/common/no_data_hua.png`
  55. }
  56. },
  57. data() {
  58. return {}
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .app-empty {
  64. width: 100%;
  65. display: flex;
  66. align-items: center;
  67. & .app-empty-center {
  68. width: 100%;
  69. }
  70. & .app_empty_img {
  71. width: 100%;
  72. margin-top:100upx;
  73. text-align: center;
  74. & image {
  75. margin:0 auto;
  76. width:260upx;
  77. }
  78. }
  79. & .app-empty-title {
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. font-size: 32upx;
  84. color: #cccccc;
  85. margin-top:30upx;
  86. & span {
  87. font-weight: 400;
  88. & + span {
  89. font-weight: initial;
  90. margin-top: 10upx;
  91. font-size: 26upx;
  92. }
  93. }
  94. & .empty_noData {
  95. font-size: 26upx;
  96. }
  97. }
  98. }
  99. </style>