style-eleven.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="style-eleven dir-left-nowrap">
  3. <app-category-list
  4. @click="active"
  5. :list="list"
  6. v-if="list.length>0"
  7. :noSetHeight="setHeight+'rpx'"
  8. ></app-category-list>
  9. <scroll-view scroll-y
  10. v-if="list.length !== 0"
  11. :class="goods_list.length > 0 && list.length === 0 ? 'goods-list-right' : 'right'"
  12. @scrolltolower="lower"
  13. :style="{height: `${setHeight}rpx`}"
  14. >
  15. <image
  16. class="advert_pic"
  17. :src="list[activeIndex].advert_pic"
  18. v-if="list[activeIndex].advert_pic"
  19. @click="route_advert(list[activeIndex])"
  20. ></image>
  21. <second-class
  22. v-if="list.length !== 0 && list[activeIndex].child.length !== 0"
  23. @setNav="setNav"
  24. :list="list[activeIndex].child"
  25. :activeIndexTwo="activeIndexTwo"
  26. ></second-class>
  27. <view class="cat-list" v-for="(it, key) in goods_list" :key="key">
  28. <view class="cat-title">{{it.name}}</view>
  29. <product-list
  30. v-if="it.goods_list.length > 0"
  31. :goods_list="it.goods_list"
  32. @attr="attr"
  33. ></product-list>
  34. </view>
  35. <template v-if="goods_list.length === 0 && list.length !== 0">
  36. <app-no-goods title="该分类下无相关内容哦~" ></app-no-goods>
  37. </template>
  38. </scroll-view>
  39. </view>
  40. </template>
  41. <script>
  42. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  43. import productList from './product-list.vue';
  44. import goodsList from './goods-list.vue';
  45. import secondClass from './second-class.vue';
  46. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  47. export default {
  48. name: "style-eleven",
  49. components: {
  50. 'app-category-list': appCategoryList,
  51. 'product-list': productList,
  52. 'app-no-goods': appNoGoods,
  53. 'goods-list': goodsList,
  54. 'second-class': secondClass,
  55. },
  56. props: [`list`, `activeIndex`, `setHeight`, `goods_list`, `activeIndexTwo`],
  57. methods: {
  58. active(item) {
  59. this.$emit('requestCatList', item);
  60. this.$emit('active', item);
  61. },
  62. lower() {
  63. this.$emit('lower', this.list[this.activeIndex]);
  64. },
  65. setNav(it, key) {
  66. this.$emit('setNav',it, key);
  67. },
  68. attr(previewUrl, submitUrl, attr_groups, goods) {
  69. this.$emit('attr', previewUrl, submitUrl, attr_groups, goods);
  70. },
  71. route_advert(data) {
  72. this.$emit('route_advert', data);
  73. }
  74. },
  75. }
  76. </script>
  77. <style scoped lang="scss">
  78. .right {
  79. width: #{546upx};
  80. background-color: white;
  81. padding-left: #{24upx};
  82. }
  83. .goods-list-right {
  84. width: #{750upx};
  85. background-color: white;
  86. }
  87. .advert_pic {
  88. width: #{500rpx};
  89. height: #{184rpx};
  90. margin: #{20rpx} #{24rpx} #{20rpx} 0;
  91. }
  92. .item {
  93. padding: #{20upx 0};
  94. }
  95. .no-empty {
  96. width: 100%;
  97. margin-top: #{150upx};
  98. }
  99. .cat-title {
  100. font-size: #{26upx};
  101. line-height: 1;
  102. color: #999999;
  103. margin: #{32upx 0};
  104. }
  105. </style>