style-nine.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="style-nine 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 class="advert_pic"
  21. :src="list[activeIndex].advert_pic"
  22. v-if="list[activeIndex].advert_pic"
  23. ></image>
  24. </app-jump-button>
  25. </view>
  26. <product-list :theme="theme" v-if="goods_list.length > 0 && list.length > 0" @attr="attr" :goods_list="goods_list"></product-list>
  27. <template v-if="goods_list.length === 0 && is_over_goods">
  28. <app-no-goods title="该分类下无相关内容哦~"></app-no-goods>
  29. </template>
  30. </scroll-view>
  31. <goods-list
  32. @attr="attr"
  33. :theme="theme"
  34. v-if="goods_list.length > 0 && list.length === 0"
  35. :goods_list="goods_list"
  36. ></goods-list>
  37. <view class="no-empty main-center" v-if="list.length === 0 && goods_list.length === 0">
  38. <app-no-goods title="该分类下无相关内容哦~" ></app-no-goods>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  44. import productList from './product-list.vue';
  45. import goodsList from './goods-list.vue';
  46. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  47. export default {
  48. name: "style-nine",
  49. components: {
  50. 'app-category-list': appCategoryList,
  51. 'product-list': productList,
  52. 'app-no-goods': appNoGoods,
  53. 'goods-list': goodsList
  54. },
  55. props: [`list`, `activeIndex`, `setHeight`, `goods_list`, `theme`, `is_over_goods`],
  56. methods: {
  57. active(item) {
  58. this.$emit('requestGoods', item);
  59. this.$emit('active', item);
  60. this.$emit('page');
  61. },
  62. lower() {
  63. this.$emit('lower', this.list[this.activeIndex]);
  64. },
  65. attr(previewUrl, submitUrl, attr_groups, goods) {
  66. this.$emit('attr', previewUrl, submitUrl, attr_groups, goods);
  67. },
  68. route_advert(data) {
  69. this.$emit('route_advert', data);
  70. }
  71. },
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .style-nine {
  76. background-color: white;
  77. }
  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. </style>