second-one.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. >
  15. <image class="goods-img" :src="sheep.$url.cdn(item.image)" mode="aspectFill"></image>
  16. <view class="ss-p-10">
  17. <view class="goods-title ss-line-1">{{ item.name }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script setup>
  24. import sheep from '@/sheep';
  25. const props = defineProps({
  26. data: {
  27. type: Object,
  28. default: () => ({}),
  29. },
  30. activeMenu: [Number, String],
  31. pagination: Object,
  32. });
  33. </script>
  34. <style lang="scss" scoped>
  35. .title-box {
  36. .title-line-left,
  37. .title-line-right {
  38. width: 15px;
  39. height: 1px;
  40. background: #d2d2d2;
  41. }
  42. }
  43. .goods-item {
  44. width: calc((100% - 20px) / 3);
  45. margin-right: 10px;
  46. margin-bottom: 10px;
  47. &:nth-of-type(3n) {
  48. margin-right: 0;
  49. }
  50. .goods-img {
  51. width: calc((100vw - 140px) / 3);
  52. height: calc((100vw - 140px) / 3);
  53. }
  54. .goods-title {
  55. font-size: 26rpx;
  56. font-weight: bold;
  57. color: #333333;
  58. line-height: 40rpx;
  59. text-align: center;
  60. }
  61. .goods-price {
  62. color: $red;
  63. line-height: 40rpx;
  64. }
  65. }
  66. </style>