style-seven.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="style-seven 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="top 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 class="item-child dir-top-nowrap" v-for="(a, i) in item.child" :key="i" @click="getChild(key, i)">
  29. <image :src="a.pic_url" class="pic_url"></image>
  30. <text class="text t-omit" >{{a.name}}</text>
  31. </view>
  32. </view>
  33. <template v-if="list[activeIndex].child.length === 0 && list.length !== 0">
  34. <app-no-goods title="该分类下无相关内容哦~" ></app-no-goods>
  35. </template>
  36. </scroll-view>
  37. </view>
  38. </template>
  39. <script>
  40. import appCategoryList from '../../components/page-component/app-category-list/app-category-list.vue';
  41. import appNoGoods from '../../components/page-component/app-no-goods/app-no-goods.vue';
  42. export default {
  43. name: "style-seven",
  44. components: {
  45. 'app-category-list': appCategoryList,
  46. 'app-no-goods': appNoGoods
  47. },
  48. props: [`list`, `activeIndex`, `setHeight`, `theme`],
  49. methods: {
  50. active({item}) {
  51. this.$emit('active', item);
  52. },
  53. route_go(data) {
  54. if (!data) return;
  55. uni.navigateTo({url: data});
  56. },
  57. getChild(key, i) {
  58. uni.navigateTo({url: this.list[this.activeIndex].child[key].child[i].page_url});
  59. },
  60. route_advert(data) {
  61. this.$emit('route_advert', data);
  62. }
  63. },
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .style-seven {
  68. width: #{750upx};
  69. }
  70. .right {
  71. width: #{546rpx};
  72. background-color: white;
  73. }
  74. .advert_pic {
  75. width: #{500rpx};
  76. height: #{184rpx};
  77. margin: #{20upx 24upx 40upx 24upx};
  78. }
  79. .item {
  80. width: #{546rpx};
  81. }
  82. .top {
  83. width: 100%;
  84. padding-left: #{24rpx};
  85. margin-bottom: #{40rpx};
  86. }
  87. .name {
  88. font-size: #{28rpx};
  89. color: #353535;
  90. width: 40%;
  91. }
  92. .icon {
  93. position: absolute;
  94. right: #{24rpx};
  95. }
  96. .more-text {
  97. font-size: #{26rpx};
  98. color: #999999;
  99. margin-left: #{16rpx};
  100. }
  101. .icon-pic {
  102. width: #{13rpx};
  103. height: #{22rpx};
  104. background-image: url("../../static/image/icon/arrow-right.png");
  105. background-size: 100% 100%;
  106. background-repeat: no-repeat;
  107. margin-left: #{24rpx};
  108. }
  109. .pic_url {
  110. width: #{104rpx};
  111. height: #{104rpx};
  112. }
  113. .text {
  114. font-size: #{26rpx};
  115. line-height: 1;
  116. color: #353535;
  117. margin-top: #{8rpx};
  118. text-align: center;
  119. }
  120. .item-child {
  121. display: inline-block;
  122. height: #{138rpx};
  123. width: #{182rpx};
  124. margin-bottom: #{40rpx};
  125. text-align: center;
  126. }
  127. </style>