t-i-bottom.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="content">
  3. <view class="section_1" v-if="bottom.length > 0 && bottom[0].children[0].children.length > 0">
  4. <scroll-view scroll-x>
  5. <view class="tab_box">
  6. <view class="tab" v-for="(item,index) in bottom[0].children" :key="index">
  7. <view class="title" @click="change_active(index+1)" :class="active==index+1?'active':''">{{item.title}}</view>
  8. </view>
  9. </view>
  10. </scroll-view>
  11. <view v-for="(item,index) in bottom[0].children" :key="index">
  12. <view class="list" v-if="index+1 == active">
  13. <view class="item" v-for="(item_2,index_2) in item.children" :key="index_2" @click="go_record(item_2)">
  14. {{item_2.title}}
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 图片链接 -->
  20. <view class="section_2" v-if="bottom.length > 0 && bottom[2].children.length > 0">
  21. <view class="title">图片链接</view>
  22. <view class="list">
  23. <view class="item" v-for="(item,index) in bottom[2].children" :key="index" @click="go_record(item)">
  24. <image :src="item.thumb" mode=""></image>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 快速通道 -->
  29. <view class="section_3" v-if="bottom.length > 0 && bottom[3].children.length > 0">
  30. <view class="title">快速通道</view>
  31. <view class="list">
  32. <view class="item" v-for="(item,index) in bottom[3].children" :key="index" @click="go_record(item)">
  33. <image :src="item.thumb" mode="widthFix"></image>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. goToLink
  42. } from "@/common/common.js"
  43. export default {
  44. name: "t-i-bottom",
  45. props: [
  46. "bottom",
  47. "mine_code"
  48. ],
  49. data() {
  50. return {
  51. active: 1,
  52. };
  53. },
  54. methods: {
  55. change_active(index) {
  56. console.log(index)
  57. this.active = index
  58. },
  59. go_record(item) {
  60. goToLink(item, this.mine_code)
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss">
  66. .content {
  67. margin-top: 10rpx;
  68. padding-bottom: 40rpx;
  69. background-color: #FFFFFF;
  70. }
  71. .section_1 {
  72. box-sizing: border-box;
  73. padding: 25rpx;
  74. .tab_box{
  75. display: flex;
  76. .tab {
  77. margin-right: 40rpx;
  78. text-align: center;
  79. .title {
  80. width: 300rpx;
  81. height: 80rpx;
  82. line-height: 80rpx;
  83. font-size: 36rpx;
  84. }
  85. .active {
  86. color: #009fe8;
  87. border-bottom: 4rpx solid #009fe8;
  88. }
  89. }
  90. }
  91. .list {
  92. margin-top: 30rpx;
  93. overflow: hidden;
  94. .item {
  95. float: left;
  96. margin-right: 20rpx;
  97. margin-bottom: 30rpx;
  98. width: 160rpx;
  99. box-sizing: border-box;
  100. border: 2rpx solid #009fe8;
  101. border-radius: 20rpx;
  102. font-size: 28rpx;
  103. line-height: 70rpx;
  104. //超过一行省略号
  105. overflow: hidden;
  106. white-space: nowrap;
  107. text-overflow: ellipsis;
  108. padding: 0 10rpx;
  109. background-color: #66C7F218;
  110. color: #009FE8;
  111. text-align: center;
  112. }
  113. .item:nth-child(4n) {
  114. margin-right: 0;
  115. }
  116. }
  117. }
  118. .section_2 {
  119. box-sizing: border-box;
  120. padding: 0 25rpx;
  121. .title {
  122. line-height: 120rpx;
  123. font-size: 36rpx;
  124. }
  125. .list {
  126. display: flex;
  127. flex-wrap: wrap;
  128. justify-content: space-between;
  129. .item {
  130. margin-bottom: 20rpx;
  131. width: 340rpx;
  132. height: 180rpx;
  133. border-radius: 20rpx;
  134. overflow: hidden;
  135. image {
  136. width: 340rpx;
  137. height: 180rpx;
  138. }
  139. }
  140. }
  141. }
  142. .section_3 {
  143. box-sizing: border-box;
  144. padding: 0 25rpx;
  145. .title {
  146. line-height: 120rpx;
  147. font-size: 36rpx;
  148. }
  149. .list {
  150. display: flex;
  151. flex-wrap: wrap;
  152. justify-content: space-between;
  153. .item {
  154. margin-bottom: 20rpx;
  155. width: 700rpx;
  156. border-radius: 10rpx;
  157. overflow: hidden;
  158. image {
  159. width: 700rpx;
  160. }
  161. }
  162. }
  163. }
  164. </style>