style-nine.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. ></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 class="advert_pic"
  16. :src="list[activeIndex].advert_pic"
  17. v-if="list[activeIndex].advert_pic"
  18. @click="route_advert(list[activeIndex])"
  19. ></image>
  20. <product-list v-if="goods_list.length > 0 && list.length > 0" @attr="attr" :goods_list="goods_list"></product-list>
  21. <template v-if="goods_list.length === 0">
  22. <app-no-goods title="该分类下无相关内容哦~"></app-no-goods>
  23. </template>
  24. </scroll-view>
  25. <goods-list
  26. @attr="attr"
  27. v-if="goods_list.length > 0 && list.length === 0"
  28. :goods_list="goods_list"
  29. ></goods-list>
  30. <view class="no-empty main-center" v-if="list.length === 0 && goods_list.length === 0">
  31. <app-no-goods title="该分类下无相关内容哦~" background="#f7f7f7"></app-no-goods>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  37. import productList from './product-list.vue';
  38. import goodsList from './goods-list.vue';
  39. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  40. export default {
  41. name: "style-nine",
  42. components: {
  43. 'app-category-list': appCategoryList,
  44. 'product-list': productList,
  45. 'app-no-goods': appNoGoods,
  46. 'goods-list': goodsList,
  47. },
  48. props: [`list`, `activeIndex`, `setHeight`, `goods_list`],
  49. methods: {
  50. active(item) {
  51. this.$emit('requestGoods', item);
  52. this.$emit('active', item);
  53. this.$emit('page');
  54. },
  55. lower() {
  56. this.$emit('lower', this.list[this.activeIndex]);
  57. },
  58. attr(previewUrl, submitUrl, attr_groups, goods) {
  59. this.$emit('attr', previewUrl, submitUrl, attr_groups, goods);
  60. },
  61. route_advert(data) {
  62. this.$emit('route_advert', data);
  63. }
  64. },
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. .right {
  69. width: #{546upx};
  70. background-color: white;
  71. padding-left: #{24upx};
  72. }
  73. .goods-list-right {
  74. width: #{750upx};
  75. background-color: white;
  76. }
  77. .advert_pic {
  78. width: #{500rpx};
  79. height: #{184rpx};
  80. margin: #{20rpx} #{24rpx} #{20rpx} 0;
  81. }
  82. .item {
  83. padding: #{20upx 0};
  84. }
  85. .no-empty {
  86. width: 100%;
  87. margin-top: #{150upx};
  88. }
  89. </style>