style-eleven.vue 4.0 KB

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