1
0

style-six.vue 3.8 KB

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