style-two.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="style-two 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. class="right"
  12. :style="{height: `${setHeight}rpx`}"
  13. v-if="list.length > 0">
  14. <view>
  15. <app-jump-button :open_type="list[activeIndex].advert_open_type"
  16. :params="list[activeIndex].advert_params"
  17. :url="list[activeIndex].advert_url">
  18. <image class="advert_pic"
  19. @click="advert(list[activeIndex])"
  20. :src="list[activeIndex].advert_pic"
  21. v-if="list[activeIndex].advert_pic"></image>
  22. </app-jump-button>
  23. </view>
  24. <view class="item"
  25. v-for="(it, k) in list[activeIndex].child"
  26. :key="k"
  27. @click="route_go(it.page_url)">
  28. <image :src="it.big_pic_url"
  29. class="big_pic_url"></image>
  30. </view>
  31. <view class="no-empty main-center"
  32. v-if="list[activeIndex].child.length === 0">
  33. <app-no-goods title="该分类下无相关内容哦~"></app-no-goods>
  34. </view>
  35. </scroll-view>
  36. <view class="no-empty main-center" v-else>
  37. <app-no-goods background="#f7f7f7" title="该分类下无相关内容哦~"></app-no-goods>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  43. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  44. export default {
  45. name: 'style-two',
  46. props: [`list`, `activeIndex`, `setHeight`, `theme`],
  47. components: {
  48. 'app-category-list': appCategoryList,
  49. 'app-no-goods': appNoGoods
  50. },
  51. methods: {
  52. active(e) {
  53. this.$emit('active', e);
  54. },
  55. route_go(e) {
  56. uni.navigateTo({
  57. url: e
  58. })
  59. },
  60. advert(e) {
  61. this.$emit('route_advert', e);
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .right {
  68. width: #{524rpx};
  69. margin-left: #{22rpx};
  70. background-color: #ffffff;
  71. }
  72. .advert_pic {
  73. width: #{500rpx};
  74. height: #{184rpx};
  75. margin: #{20upx 24upx 20upx 0};
  76. }
  77. .item {
  78. margin-left: #{2rpx};
  79. height: #{158rpx};
  80. width: #{524rpx};
  81. margin-bottom: #{20rpx};
  82. }
  83. .big_pic_url {
  84. height: #{158rpx};
  85. width: #{524rpx};
  86. }
  87. .no-empty {
  88. width: 100%;
  89. margin-top: #{150upx};
  90. }
  91. </style>