style-ten.vue 4.3 KB

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