empty.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="page-box">
  3. <view class="centre">
  4. <image v-if="globalImages" :src="globalImages + 'imgs/static/image/empty.png'" mode=""></image>
  5. <view class="tips">
  6. {{content}}
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  13. export default {
  14. props: {
  15. content: {
  16. type: String,
  17. default: '暂无内容'
  18. }
  19. },
  20. data() {
  21. return {
  22. globalImages: '',
  23. }
  24. },
  25. onLoad() {
  26. waitForGlobalImages().then((path) => {
  27. console.log('✅ 全局图片路径:', path)
  28. this.globalImages = path
  29. })
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .page-box {
  35. // position: relative;
  36. // left: 0;
  37. height: 50vh;
  38. }
  39. .centre {
  40. position: absolute;
  41. left: 0;
  42. top:0;
  43. right: 0;
  44. bottom: 0;
  45. margin: auto;
  46. height: 400rpx;
  47. text-align: center;
  48. // padding: 200rpx auto;
  49. font-size: 32rpx;
  50. image {
  51. width: 387rpx;
  52. height: 341rpx;
  53. // margin-bottom: 20rpx;
  54. margin: 0 auto 20rpx;
  55. // border: 1px dotted #000000;
  56. }
  57. .tips {
  58. font-size: 32rpx;
  59. color: #2F3044;
  60. margin-top: 20rpx;
  61. font-weight: 700;
  62. }
  63. .btn {
  64. margin: 80rpx auto;
  65. width: 600rpx;
  66. border-radius: 32rpx;
  67. line-height: 90rpx;
  68. color: #ffffff;
  69. font-size: 34rpx;
  70. background: #5074FF;
  71. }
  72. }
  73. </style>