style-two.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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">
  22. </image>
  23. </app-jump-button>
  24. </view>
  25. <!-- 分类页面跳转 -->
  26. <view class="item"
  27. v-for="(it, k) in list[activeIndex].child"
  28. :key="k"
  29. @click="route_go(it)">
  30. <!-- <image :src="it.big_pic_url"
  31. class="big_pic_url">
  32. </image> -->
  33. <view class="img_box">
  34. <image :src="it.pic_url"
  35. class="pic_url">
  36. </image>
  37. </view>
  38. <text>
  39. {{it.name}}
  40. </text>
  41. </view>
  42. <view class="no-empty main-center"
  43. v-if="list[activeIndex].child.length === 0">
  44. <app-no-goods title="该分类下无相关内容哦~"></app-no-goods>
  45. </view>
  46. </scroll-view>
  47. <view class="no-empty main-center" v-else>
  48. <app-no-goods background="#f7f7f7" title="该分类下无相关内容哦~"></app-no-goods>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  54. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  55. export default {
  56. name: 'style-two',
  57. props: [`list`, `activeIndex`, `setHeight`, `theme`],
  58. components: {
  59. 'app-category-list': appCategoryList,
  60. 'app-no-goods': appNoGoods
  61. },
  62. methods: {
  63. active({item}) {
  64. this.$emit('active', item);
  65. },
  66. route_go(e) {
  67. uni.navigateTo({
  68. url: `${e.page_url}&titleName=${e.name}`
  69. });
  70. },
  71. advert(e) {
  72. this.$emit('route_advert', e);
  73. }
  74. }
  75. }
  76. </script>
  77. <style scoped lang="scss">
  78. .right {
  79. width: #{524rpx};
  80. margin-left: #{22rpx};
  81. background-color: #ffffff;
  82. }
  83. .advert_pic {
  84. width: #{500rpx};
  85. height: #{184rpx};
  86. margin: #{20upx 24upx 20upx 0};
  87. }
  88. .item {
  89. margin-left: #{2rpx};
  90. height: #{158rpx};
  91. width: #{524rpx};
  92. margin-bottom: #{20rpx};
  93. display: flex;
  94. justify-content: flex-start;
  95. align-items: center;
  96. .img_box{
  97. height: #{128rpx};
  98. width: #{150rpx};
  99. display: flex;
  100. align-items: center;
  101. margin:0rpx 20rpx;
  102. .pic_url {
  103. display: inline-block;
  104. max-width: 100%;
  105. max-height: 80%;
  106. }
  107. }
  108. }
  109. .big_pic_url {
  110. height: #{158rpx};
  111. width: #{524rpx};
  112. }
  113. .no-empty {
  114. width: 100%;
  115. margin-top: #{150upx};
  116. }
  117. </style>