style-seven.vue 3.9 KB

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