t-i-zaoquan.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. "home_link"
  40. ],
  41. data() {
  42. return {
  43. active: 1,
  44. list: [],
  45. list_1: [],
  46. list_2: [],
  47. // 图片链接
  48. list_3: [],
  49. // 快速通道
  50. list_4: []
  51. };
  52. },
  53. mounted() {
  54. this.get_home_link()
  55. },
  56. methods: {
  57. change_active(item) {
  58. this.active = item
  59. if (item == 1) {
  60. this.list = this.list_1
  61. } else if (item == 2) {
  62. this.list = this.list_2
  63. }
  64. },
  65. get_home_link() {
  66. setTimeout(()=>{
  67. // 机关部室
  68. this.list = this.home_link[0]
  69. this.list_1 = this.home_link[0]
  70. // 基层区队
  71. this.list_2 = this.home_link[1]
  72. // 图片链接
  73. this.list_3 = this.home_link[3]
  74. // 快速通道
  75. this.list_4 = this.home_link[2]
  76. },1000)
  77. },
  78. go_record(item) {
  79. goToLink(item,this.mine_code)
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. .content {
  86. margin-top: 20rpx;
  87. background-color: #FFFFFF;
  88. }
  89. .section_1 {
  90. box-sizing: border-box;
  91. padding: 25rpx;
  92. .tab {
  93. display: flex;
  94. justify-content: space-around;
  95. .title {
  96. line-height: 80rpx;
  97. font-weight: 700;
  98. }
  99. .active {
  100. color: #009fe8;
  101. border-bottom: 6rpx solid #009fe8;
  102. }
  103. }
  104. .list {
  105. margin-top: 30rpx;
  106. overflow: hidden;
  107. .item {
  108. float: left;
  109. margin-right: 20rpx;
  110. margin-bottom: 30rpx;
  111. width: 160rpx;
  112. box-sizing: border-box;
  113. border: 2rpx solid #009fe8;
  114. border-radius: 20rpx;
  115. font-size: 28rpx;
  116. line-height: 70rpx;
  117. //超过一行省略号
  118. overflow: hidden;
  119. white-space: nowrap;
  120. text-overflow: ellipsis;
  121. padding: 0 10rpx;
  122. background-color: #66C7F218;
  123. color: #009FE8;
  124. text-align: center;
  125. }
  126. .item:nth-child(4n) {
  127. margin-right: 0;
  128. }
  129. }
  130. }
  131. .section_2 {
  132. box-sizing: border-box;
  133. padding: 0 25rpx;
  134. .list {
  135. display: flex;
  136. flex-wrap: wrap;
  137. justify-content: space-between;
  138. .item {
  139. margin-bottom: 20rpx;
  140. width: 340rpx;
  141. height: 180rpx;
  142. border-radius: 20rpx;
  143. overflow: hidden;
  144. image {
  145. width: 340rpx;
  146. height: 180rpx;
  147. }
  148. }
  149. }
  150. }
  151. .section_3 {
  152. box-sizing: border-box;
  153. padding: 0 25rpx;
  154. .title {
  155. line-height: 120rpx;
  156. font-size: 36rpx;
  157. }
  158. .list {
  159. display: flex;
  160. flex-wrap: wrap;
  161. justify-content: space-between;
  162. .item {
  163. margin-bottom: 20rpx;
  164. width: 340rpx;
  165. height: 220rpx;
  166. border-radius: 20rpx;
  167. overflow: hidden;
  168. image {
  169. width: 340rpx;
  170. height: 220rpx;
  171. }
  172. }
  173. }
  174. }
  175. </style>