style-six.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="style-six dir-left-nowrap">
  3. <app-category-list
  4. @click="active"
  5. :list="list"
  6. :noSetHeight="setHeight+'rpx'"
  7. ></app-category-list>
  8. <scroll-view scroll-y class="right" :style="{height: `${setHeight}rpx`}">
  9. <image class="advert_pic"
  10. @click="route_advert(list[activeIndex])"
  11. :src="list[activeIndex].advert_pic"
  12. v-if="list[activeIndex].advert_pic"
  13. ></image>
  14. <view class="item" v-for="(item, key) in list[activeIndex].child" :key="key">
  15. <view class="more dir-left-nowrap main-between" @click="route_go(item.page_url)">
  16. <text class="name t-omit">{{item.name}}</text>
  17. <view class="icon dir-left-nowrap cross-center">
  18. <text class="more-text">更多</text>
  19. <view class="icon-pic"></view>
  20. </view>
  21. </view>
  22. <view v-for="(a, i) in item.child" :key="i" @click.stop="getChild(key,i)">
  23. <image :src="a.big_pic_url" class="g-pic"></image>
  24. </view>
  25. </view>
  26. <view class="no-empty main-center" v-if="list[activeIndex].child.length === 0">
  27. <app-no-goods title="该分类下无相关内容哦~"></app-no-goods>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. </template>
  32. <script>
  33. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  34. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  35. export default {
  36. name: "style-six",
  37. components: {
  38. 'app-category-list': appCategoryList,
  39. 'app-no-goods': appNoGoods,
  40. },
  41. props: [`list`, `activeIndex`, `setHeight`],
  42. methods: {
  43. active(item) {
  44. this.$emit('active', item);
  45. },
  46. route_go(data) {
  47. if (!data) return;
  48. uni.navigateTo({
  49. url: data
  50. });
  51. },
  52. getChild(key, i) {
  53. uni.navigateTo({
  54. url: this.list[this.activeIndex].child[key].child[i].page_url
  55. });
  56. },
  57. route_advert(data) {
  58. this.$emit('route_advert', data);
  59. }
  60. },
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .advert_pic {
  65. width: #{500rpx};
  66. height: #{184rpx};
  67. margin: #{20rpx} #{24rpx} #{20rpx} 0;
  68. }
  69. .right {
  70. width: #{546rpx};
  71. background-color: white;
  72. padding-left: #{24upx};
  73. }
  74. .item {
  75. margin-left: #{2rpx};
  76. width: #{524rpx};
  77. }
  78. .more {
  79. position: relative;
  80. width: #{524rpx};
  81. margin: #{20rpx} 0 #{40rpx} 0;
  82. }
  83. .more-text {
  84. font-size: #{26rpx};
  85. color: #999999;
  86. margin-left: #{16rpx};
  87. }
  88. .icon-pic {
  89. width: #{13rpx};
  90. height: #{22rpx};
  91. background-image: url("../../static/image/icon/arrow-right.png");
  92. background-size: 100% 100%;
  93. background-repeat: no-repeat;
  94. margin-left: #{24rpx};
  95. }
  96. .name {
  97. font-size: #{28rpx};
  98. color: #353535;
  99. width: 40%;
  100. }
  101. .icon {
  102. position: absolute;
  103. right: #{24rpx};
  104. }
  105. .g-pic {
  106. width: #{500rpx};
  107. height: #{158rpx};
  108. margin-bottom: #{20rpx};
  109. }
  110. </style>