style-eleven.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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(t) {
  67. this.$emit('requestCatList', t);
  68. this.$emit('active', t);
  69. },
  70. lower() {
  71. this.$emit('lower', this.list[this.activeIndex]);
  72. },
  73. setNav(t, k) {
  74. this.$emit('setNav',t, k);
  75. },
  76. attr(previewUrl, submitUrl, attr_groups, goods) {
  77. this.$emit('attr', previewUrl, submitUrl, attr_groups, goods);
  78. },
  79. route_advert(data) {
  80. this.$emit('route_advert', data);
  81. }
  82. },
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .right {
  87. width: #{546upx};
  88. background-color: white;
  89. padding-left: #{24upx};
  90. }
  91. .goods-list-right {
  92. width: #{750upx};
  93. background-color: white;
  94. }
  95. .advert_pic {
  96. width: #{500rpx};
  97. height: #{184rpx};
  98. margin: #{20upx 24upx 20upx 0};
  99. }
  100. .item {
  101. padding: #{20upx 0};
  102. }
  103. .no-empty {
  104. width: 100%;
  105. margin-top: #{150upx};
  106. }
  107. .cat-title {
  108. font-size: #{26upx};
  109. line-height: 1;
  110. color: #999999;
  111. margin: #{32upx 0};
  112. }
  113. </style>