second-one.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!-- 页面 -->
  2. <template>
  3. <view>
  4. <view class="title-box ss-flex ss-col-center ss-row-center ss-p-b-30">
  5. <view class="title-line-left"></view>
  6. <view class="title-text ss-p-x-20">{{ props.data.children[activeMenu].name }}</view>
  7. <view class="title-line-right"></view>
  8. </view>
  9. <view class="goods-item-box ss-flex ss-flex-wrap ss-p-b-20">
  10. <view
  11. class="goods-item"
  12. v-for="item in props.data.children[activeMenu].children"
  13. :key="item.id"
  14. @tap="
  15. sheep.$router.go('/pages/goods/list', {
  16. categoryId: item.id,
  17. })
  18. "
  19. >
  20. <image class="goods-img" :src="sheep.$url.cdn(item.image)" mode="aspectFill"></image>
  21. <view class="ss-p-10">
  22. <view class="goods-title ss-line-1">{{ item.name }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script setup>
  29. import sheep from '@/sheep';
  30. const props = defineProps({
  31. data: {
  32. type: Object,
  33. default: () => ({}),
  34. },
  35. activeMenu: [Number, String],
  36. pagination: Object,
  37. });
  38. </script>
  39. <style lang="scss" scoped>
  40. .title-box {
  41. .title-line-left,
  42. .title-line-right {
  43. width: 15px;
  44. height: 1px;
  45. background: #d2d2d2;
  46. }
  47. }
  48. .goods-item {
  49. width: calc((100% - 20px) / 3);
  50. margin-right: 10px;
  51. margin-bottom: 10px;
  52. &:nth-of-type(3n) {
  53. margin-right: 0;
  54. }
  55. .goods-img {
  56. width: calc((100vw - 140px) / 3);
  57. height: calc((100vw - 140px) / 3);
  58. }
  59. .goods-title {
  60. font-size: 26rpx;
  61. font-weight: bold;
  62. color: #333333;
  63. line-height: 40rpx;
  64. text-align: center;
  65. }
  66. .goods-price {
  67. color: $red;
  68. line-height: 40rpx;
  69. }
  70. }
  71. </style>