t-o-news-tab-1.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <view class="item" @click="change_active(1)">
  5. <view class="text" :class="active == 1?'active':''">安全管理</view>
  6. <view class="line" v-if="active == 1"></view>
  7. </view>
  8. <view class="item" @click="change_active(2)">
  9. <view class="text" :class="active == 2?'active':''">巡检维护</view>
  10. <view class="line" v-if="active == 2"></view>
  11. </view>
  12. <view class="item" @click="change_active(3)">
  13. <view class="text" :class="active == 3?'active':''">党建经营</view>
  14. <view class="line" v-if="active == 3"></view>
  15. </view>
  16. <view class="item" @click="change_active(4)">
  17. <view class="text" :class="active == 4?'active':''">其他</view>
  18. <view class="line" v-if="active == 4"></view>
  19. </view>
  20. </view>
  21. <view class="list">
  22. <view class="item" v-for="(item,index) in list" :key="index">
  23. <view class="title">{{item.title}}</view>
  24. <uni-table border emptyText="暂无更多数据">
  25. <!-- 表头行 -->
  26. <uni-tr>
  27. <uni-th align="center" width="60">序号</uni-th>
  28. <uni-th align="center" v-for="(item_2,index_2) in item.name">{{item_2}}</uni-th>
  29. </uni-tr>
  30. <!-- 表格数据行 -->
  31. <uni-tr v-for="(item_2,index_2) in item.data" :key="index_2">
  32. <uni-td align="center">
  33. <view class="icon">
  34. <image v-if="index_2 < 3" src="./icon/new.png" mode=""></image> <text
  35. style="margin-left: 10rpx;">{{index_2+1}}</text>
  36. </view>
  37. </uni-td>
  38. <uni-td align="center" v-for="(item_3,index_3) in item_2" :key="index_3">{{item_3}}</uni-td>
  39. </uni-tr>
  40. </uni-table>
  41. <view class="btn">
  42. <view class="icon">
  43. <image src="./icon/btn.png" mode=""></image>
  44. </view>
  45. <view class="btn_text" @click="go_all_list(item.title,item.table)">点击查看全部信息</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. name: "t-o-news-tab-1",
  54. data() {
  55. return {
  56. active: 1,
  57. list:[]
  58. };
  59. },
  60. mounted() {
  61. this.get_list()
  62. },
  63. methods: {
  64. change_active(item) {
  65. this.active = item
  66. },
  67. get_list() {
  68. this.$api.five_fixed_fiveFixed({
  69. }).then((res)=>{
  70. console.log(res.data.content.data)
  71. this.list = res.data.content.data
  72. })
  73. },
  74. go_all_list(title,table) {
  75. uni.navigateTo({
  76. url: "../../origanization/news/tab_1/all_list/all_list?title="+title+"&table="+table
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. .uni-table-th.table--border {
  84. color: #000000;
  85. background-color: #D8D8D8;
  86. }
  87. .uni-table-td.table--border {
  88. color: #666666;
  89. }
  90. .tab {
  91. display: flex;
  92. justify-content: space-around;
  93. align-items: center;
  94. background-color: #FFFFFF;
  95. margin-bottom: 20rpx;
  96. height: 90rpx;
  97. .item {
  98. position: relative;
  99. .text {
  100. font-size: 30rpx;
  101. color: #666666;
  102. }
  103. .active {
  104. font-weight: 700;
  105. color: #000000;
  106. }
  107. .line {
  108. position: absolute;
  109. bottom: -15rpx;
  110. left: 50%;
  111. transform: translateX(-30rpx);
  112. width: 60rpx;
  113. height: 4rpx;
  114. background-color: #009FE8;
  115. }
  116. }
  117. }
  118. .list {
  119. box-sizing: border-box;
  120. padding: 0 25rpx;
  121. .item {
  122. margin-bottom: 20rpx;
  123. width: 700rpx;
  124. background-color: #FFFFFF;
  125. border-radius: 20rpx;
  126. box-sizing: border-box;
  127. padding: 0 25rpx;
  128. padding-bottom: 20rpx;
  129. .title {
  130. text-align: center;
  131. height: 120rpx;
  132. line-height: 120rpx;
  133. font-size: 40rpx;
  134. font-weight: 700;
  135. }
  136. .btn {
  137. margin: 20rpx auto;
  138. width: 400rpx;
  139. height: 50rpx;
  140. background-color: #69BBFA;
  141. border-radius: 50rpx;
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. .icon {
  146. image {
  147. width: 23rpx;
  148. height: 24rpx;
  149. display: block;
  150. }
  151. }
  152. .btn_text {
  153. margin-left: 10rpx;
  154. font-size: 28rpx;
  155. color: #FFFFFF;
  156. }
  157. }
  158. }
  159. }
  160. .icon {
  161. position: relative;
  162. top: 0;
  163. right: 0;
  164. image {
  165. width: 33rpx;
  166. height: 18rpx;
  167. }
  168. }
  169. </style>