empty.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="empty-content">
  3. <image class="empty-content-image" src="/static/icon_empty.png" mode="aspectFit"></image>
  4. <text class="error-text">{{EmptyText}}</text>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. src: {
  11. type: String,
  12. default: 'empty'
  13. },
  14. typeIndex:{
  15. type:String,
  16. default: 'empty'
  17. },
  18. navbarHeight:{
  19. type:Number
  20. }
  21. },
  22. data() {
  23. return {
  24. typeSrcall: {
  25. empty: 'https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AcewRAAEtqt4jZmU397.png',
  26. },
  27. typeSrc: {
  28. empty: 'https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AJZvwAAGWWe4DnXk371.png',
  29. },
  30. EmptyText:'',
  31. }
  32. },
  33. created(){
  34. if(this.typeIndex==0){
  35. this.EmptyText = '暂无数据~'
  36. }else{
  37. this.EmptyText = '暂无数据~'
  38. }
  39. },
  40. computed: {
  41. setSrc() {
  42. let url;
  43. if(this.typeIndex==0){
  44. url = this.typeSrcall[this.src]
  45. }else{
  46. url = this.typeSrc[this.src]
  47. }
  48. return url;
  49. },
  50. },
  51. }
  52. </script>
  53. <style lang="scss">
  54. .empty-content {
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. flex-direction: column;
  59. margin: auto;
  60. background: $bg-color;
  61. height: 700rpx;
  62. z-index: 999;
  63. &-image {
  64. width: 200rpx;
  65. height: 200rpx;
  66. }
  67. .error-text{
  68. font-size: $font-size-28;
  69. color: #666666;
  70. line-height: 88rpx;
  71. }
  72. }
  73. </style>