style-seven.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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({
  56. url: data
  57. });
  58. },
  59. getChild(key, i) {
  60. uni.navigateTo({
  61. url: this.list[this.activeIndex].child[key].child[i].page_url
  62. });
  63. },
  64. route_advert(data) {
  65. this.$emit('route_advert', data);
  66. }
  67. },
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .style-seven {
  72. width: #{750upx};
  73. }
  74. .right {
  75. width: #{546rpx};
  76. background-color: white;
  77. }
  78. .advert_pic {
  79. width: #{500rpx};
  80. height: #{184rpx};
  81. margin: #{20upx 24upx 40upx 24upx};
  82. }
  83. .item {
  84. width: #{546rpx};
  85. }
  86. .top {
  87. width: 100%;
  88. padding-left: #{24rpx};
  89. margin-bottom: #{40rpx};
  90. }
  91. .name {
  92. font-size: #{28rpx};
  93. color: #353535;
  94. width: 40%;
  95. }
  96. .icon {
  97. position: absolute;
  98. right: #{24rpx};
  99. }
  100. .more-text {
  101. font-size: #{26rpx};
  102. color: #999999;
  103. margin-left: #{16rpx};
  104. }
  105. .icon-pic {
  106. width: #{13rpx};
  107. height: #{22rpx};
  108. background-image: url("../../static/image/icon/arrow-right.png");
  109. background-size: 100% 100%;
  110. background-repeat: no-repeat;
  111. margin-left: #{24rpx};
  112. }
  113. .pic_url {
  114. width: #{104rpx};
  115. height: #{104rpx};
  116. }
  117. .text {
  118. font-size: #{26rpx};
  119. line-height: 1;
  120. color: #353535;
  121. margin-top: #{8rpx};
  122. text-align: center;
  123. }
  124. .item-child {
  125. display: inline-block;
  126. height: #{138rpx};
  127. width: #{182rpx};
  128. margin-bottom: #{40rpx};
  129. text-align: center;
  130. }
  131. </style>