1
0

style-four.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="style-four dir-left-nowrap">
  3. <app-category-list
  4. @click="active"
  5. :list="list"
  6. :noSetHeight="setHeight+'rpx'"
  7. v-if="list.length !== 0"
  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. :src="list[activeIndex].advert_pic"
  20. v-if="list[activeIndex].advert_pic"></image>
  21. </app-jump-button>
  22. </view>
  23. <view class="item dir-top-nowrap main-left cross-center"
  24. @click="route_go(it.page_url)"
  25. v-for="(it, key) in list[activeIndex].child"
  26. :key="key">
  27. <image :src="it.pic_url" class="pic_url"></image>
  28. <text class="name t-omit">{{it.name}}</text>
  29. </view>
  30. <view class="no-empty main-center"
  31. v-if="list[activeIndex].child.length === 0">
  32. <app-no-goods title="该分类下无相关内容哦~"></app-no-goods>
  33. </view>
  34. </scroll-view>
  35. <view class="no-empty main-center" v-else>
  36. <app-no-goods background="#f7f7f7" title="该分类下无相关内容哦~"></app-no-goods>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  42. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  43. export default {
  44. name: "style-four",
  45. components: {
  46. 'app-category-list': appCategoryList,
  47. 'app-no-goods': appNoGoods,
  48. },
  49. props: [`list`, `activeIndex`, `setHeight`, `theme`],
  50. methods: {
  51. active(item) {
  52. this.$emit('active', item);
  53. },
  54. route_go(data) {
  55. if (!data) return;
  56. uni.navigateTo({
  57. url: data
  58. });
  59. },
  60. route_advert(data) {
  61. this.$emit('route_advert', data);
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .right {
  68. width: #{546rpx};
  69. background-color: #ffffff;
  70. }
  71. .advert_pic {
  72. width: #{500rpx};
  73. height: #{184rpx};
  74. margin: #{20rpx} #{24rpx} #{20rpx} #{24rpx};
  75. }
  76. .item {
  77. width: #{182rpx};
  78. height: #{138rpx};
  79. display: inline-block;
  80. margin-bottom: #{40rpx};
  81. text-align: center;
  82. }
  83. .pic_url {
  84. height: #{104rpx};
  85. width: #{104rpx};
  86. }
  87. .name {
  88. font-size: #{26rpx};
  89. margin-top: #{8rpx};
  90. color: #353535;
  91. text-align: center;
  92. }
  93. .no-empty {
  94. width: 100%;
  95. margin-top: #{150upx};
  96. }
  97. </style>