t-i-jinfeng.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. "home_link"
  23. ],
  24. data() {
  25. return {
  26. active: 1,
  27. list: [],
  28. };
  29. },
  30. mounted() {
  31. this.get_home_link()
  32. },
  33. methods: {
  34. change_active(item) {
  35. this.active = item
  36. if (item == 1) {
  37. this.list = this.home_link[0]
  38. } else if (item == 2) {
  39. this.list = this.home_link[1]
  40. }
  41. },
  42. get_home_link(){
  43. setTimeout(()=>{
  44. this.list = this.home_link[0]
  45. },1000)
  46. },
  47. go_record(item) {
  48. goToLink(item,this.mine_code)
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss">
  54. .content {
  55. margin-top: 20rpx;
  56. background-color: #FFFFFF;
  57. }
  58. .section_1 {
  59. box-sizing: border-box;
  60. padding: 25rpx;
  61. .tab {
  62. display: flex;
  63. justify-content: space-around;
  64. .title {
  65. line-height: 80rpx;
  66. font-weight: 700;
  67. }
  68. .active {
  69. color: #009fe8;
  70. border-bottom: 6rpx solid #009fe8;
  71. }
  72. }
  73. .list {
  74. margin-top: 30rpx;
  75. overflow: hidden;
  76. .item {
  77. float: left;
  78. margin-right: 20rpx;
  79. margin-bottom: 30rpx;
  80. width: 160rpx;
  81. box-sizing: border-box;
  82. border: 2rpx solid #009fe8;
  83. border-radius: 20rpx;
  84. font-size: 28rpx;
  85. line-height: 70rpx;
  86. //超过一行省略号
  87. overflow: hidden;
  88. white-space: nowrap;
  89. text-overflow: ellipsis;
  90. padding: 0 10rpx;
  91. background-color: #66C7F218;
  92. color: #009FE8;
  93. text-align: center;
  94. }
  95. .item:nth-child(4n) {
  96. margin-right: 0;
  97. }
  98. }
  99. }
  100. .section_2 {
  101. box-sizing: border-box;
  102. padding: 0 25rpx;
  103. .list {
  104. display: flex;
  105. flex-wrap: wrap;
  106. justify-content: space-between;
  107. .item {
  108. margin-bottom: 20rpx;
  109. width: 340rpx;
  110. height: 180rpx;
  111. border-radius: 20rpx;
  112. overflow: hidden;
  113. image {
  114. width: 340rpx;
  115. height: 180rpx;
  116. }
  117. }
  118. }
  119. }
  120. .section_3 {
  121. box-sizing: border-box;
  122. padding: 0 25rpx;
  123. .title {
  124. line-height: 120rpx;
  125. font-size: 36rpx;
  126. font-weight: 700;
  127. }
  128. .list {
  129. display: flex;
  130. flex-wrap: wrap;
  131. justify-content: space-between;
  132. .item {
  133. margin-bottom: 20rpx;
  134. width: 340rpx;
  135. height: 220rpx;
  136. border-radius: 20rpx;
  137. overflow: hidden;
  138. image {
  139. width: 340rpx;
  140. height: 220rpx;
  141. }
  142. }
  143. }
  144. }
  145. </style>