third-one.vue 2.0 KB

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