t-i-jinjiaqu - 副本.vue 3.6 KB

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