t-i-jinfeng - 副本.vue 3.0 KB

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