style-two.vue 2.5 KB

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