ProductSkeleton.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view v-if="isFirst">
  3. <Skeleton :loading="isFirst && loading" :animation="true" bg-color="#FFF" />
  4. <view class="skeleton_content u-skeleton">
  5. <view class="empty_row"></view>
  6. <view class="product_box">
  7. <view v-for="item in 40" class="product_item ">
  8. <view class="image u-skeleton-fillet"></view>
  9. <view class="text_box ">
  10. <view v-for="item in 2" class="text u-skeleton-fillet"></view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import Skeleton from '@/components/Skeleton'
  19. export default {
  20. name: 'ProductSkeleton',
  21. components: { Skeleton },
  22. props: {
  23. isFirst: {
  24. type: Boolean,
  25. default: () => true
  26. },
  27. loading: {
  28. type: Boolean,
  29. default: () => true
  30. }
  31. },
  32. data() {
  33. return {}
  34. },
  35. methods: {}
  36. }
  37. </script>
  38. <style
  39. lang="scss"
  40. scoped
  41. >
  42. .skeleton_content {
  43. width: 100%;
  44. height: calc(100vh - 50px);
  45. padding: 30rpx 30rpx;
  46. box-sizing: border-box;
  47. .product_box {
  48. width: 100%;
  49. display: flex;
  50. justify-content: space-between;
  51. flex-wrap: wrap;
  52. .product_item {
  53. margin: 10rpx 0;
  54. width: 49%;
  55. height: 500rpx;
  56. //padding: 30rpx 30rpx;
  57. //box-sizing: border-box;
  58. .image {
  59. width: 100%;
  60. height: 70%;
  61. }
  62. .text_box {
  63. padding: 0 20rpx;
  64. .text {
  65. margin-top: 15rpx;
  66. width: 100%;
  67. height: 60rpx;
  68. }
  69. }
  70. }
  71. }
  72. }
  73. </style>