ChoiceZone.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view
  3. class="hxbox u-skeleton-fillet"
  4. v-if="hxCateList.length || skeletonShow"
  5. >
  6. <view class="title">惠选专区</view>
  7. <view class="hxClassify">
  8. <view
  9. class="item"
  10. v-for="(item) in skeletonShow ? 1 : hxCateList.slice(0, 4)"
  11. @click="jumpHxCate(item)"
  12. :key="item.id"
  13. >
  14. <image
  15. mode="widthFix"
  16. :src="`${item.cover_image}?x-oss-process=style/w_350`"
  17. ></image>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script setup>
  23. const props = defineProps({
  24. hxCateList: {
  25. type: Array,
  26. default: () => []
  27. },
  28. skeletonShow: {
  29. type: Boolean,
  30. default: false
  31. }
  32. });
  33. const emit = defineEmits(['jumpHxCate']);
  34. const jumpHxCate = (item) => {
  35. emit('jumpHxCate', item);
  36. };
  37. </script>
  38. <style scoped lang="scss">
  39. .hxbox {
  40. padding: 30rpx 30rpx 0;
  41. margin: 0rpx 30rpx 30rpx;
  42. background: linear-gradient(139deg, #ffe9c4 1%, #edffe7 100%);
  43. border-radius: 10rpx;
  44. .title {
  45. font-size: 36rpx;
  46. font-weight: bold;
  47. color: #1a1a1a;
  48. }
  49. .hxClassify {
  50. display: flex;
  51. flex-wrap: wrap;
  52. justify-content: space-between;
  53. margin-top: 30rpx;
  54. color: #373737;
  55. .item {
  56. text-align: center;
  57. margin-bottom: 20rpx;
  58. image {
  59. width: 300rpx !important;
  60. height: 210rpx !important;
  61. }
  62. }
  63. .item:first-child {
  64. margin-left: 0;
  65. }
  66. .item:nth-child(5n + 1) {
  67. margin-left: 0;
  68. }
  69. }
  70. }
  71. </style>