t-o-news-tab-2.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view>
  3. <scroll-view scroll-x>
  4. <view class="tab">
  5. <view class="item" @click="change_active(index,item)" v-for="(item,index) in fiveFixedCategory"
  6. :key="index">
  7. <view class="text" :class="active == index?'active':''">{{item}}</view>
  8. </view>
  9. </view>
  10. </scroll-view>
  11. <view class="list">
  12. <view class="item" v-for="(item,index) in list" :key="index" v-if="item.data.length > 0">
  13. <view class="title">
  14. <view class="text">{{item.title}}</view>
  15. <view class="tip" v-if="item.count > 0">{{item.count}}</view>
  16. </view>
  17. <view class="inner" v-for="(item_2,index_2) in item.data">
  18. <view class="left">
  19. <view class="user">
  20. <image :src="item_2.face" mode="aspectFill"></image>
  21. </view>
  22. </view>
  23. <view class="right">
  24. <view class="name">{{item_2.optname}}<text>{{item_2.depart}}</text></view>
  25. <view class="text">
  26. <view v-html="item_2.str"></view>
  27. </view>
  28. <view class="img_box">
  29. <view class="img" v-for="(item_3,index_3) in item_2.picture" :key="index_3">
  30. <view class="" v-for="(item_4,index_4) in item_3" :key="index_4">
  31. <image :src="item_4" mode="aspectFill" @click.stop="img_chakan(item_4)"></image>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="time">{{item_2.optdt}}</view>
  36. </view>
  37. </view>
  38. <view class="btn">
  39. <view class="icon">
  40. <image src="./icon/btn.png" mode=""></image>
  41. </view>
  42. <view class="btn_text" @click="go_all_list(item.table,item.title,item.num)">点击查看全部信息</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. name: "t-o-news-tab-2",
  51. data() {
  52. return {
  53. active: 0,
  54. // 五定表分类
  55. fiveFixedCategory: [],
  56. list: []
  57. };
  58. },
  59. mounted() {
  60. this.get_five_fixed_fiveFixedCategory()
  61. },
  62. methods: {
  63. change_active(index, item) {
  64. this.active = index
  65. this.get_five_fixed_getRecordDataByCategoryName(item)
  66. },
  67. // 记录管理分类
  68. get_five_fixed_fiveFixedCategory() {
  69. this.$api.five_fixed_fiveFixedCategory({
  70. }).then((res) => {
  71. this.fiveFixedCategory = res.data.content.data
  72. this.get_five_fixed_getRecordDataByCategoryName(res.data.content.data[0])
  73. })
  74. },
  75. // 获取记录管理列表
  76. get_five_fixed_getRecordDataByCategoryName(category_name) {
  77. uni.showLoading({
  78. mask: true
  79. })
  80. this.$api.five_fixed_getRecordDataByCategoryName({
  81. category_name: category_name
  82. }).then((res) => {
  83. uni.hideLoading()
  84. // console.log(res.data.content.data)
  85. this.list = res.data.content.data
  86. })
  87. },
  88. go_all_list(table,title,num) {
  89. uni.navigateTo({
  90. url: "../../origanization/news/tab_2/all_list/all_list?table=" + table + "&title=" + title + "&num=" + num
  91. })
  92. },
  93. img_chakan(url) {
  94. let data = []
  95. data[0] = url
  96. uni.previewImage({
  97. urls: data
  98. });
  99. },
  100. }
  101. }
  102. </script>
  103. <style lang="scss">
  104. .tab {
  105. display: flex;
  106. margin-bottom: 20rpx;
  107. background-color: #FFFFFF;
  108. box-sizing: border-box;
  109. padding: 0 20rpx;
  110. .item {
  111. background-color: #FFFFFF;
  112. .text {
  113. box-sizing: border-box;
  114. height: 90rpx;
  115. line-height: 90rpx;
  116. width: 188rpx;
  117. text-align: center;
  118. overflow: hidden;
  119. white-space: nowrap;
  120. text-overflow: ellipsis;
  121. font-size: 30rpx;
  122. color: #666666;
  123. }
  124. .active {
  125. font-weight: 700;
  126. color: #000000;
  127. border-bottom: 4rpx solid #009FE8;
  128. }
  129. }
  130. }
  131. .list {
  132. box-sizing: border-box;
  133. padding: 0 25rpx;
  134. .item {
  135. margin-bottom: 20rpx;
  136. width: 700rpx;
  137. background-color: #FFFFFF;
  138. border-radius: 20rpx;
  139. box-sizing: border-box;
  140. padding: 0 25rpx;
  141. padding-bottom: 20rpx;
  142. .title {
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. .text {
  147. text-align: center;
  148. height: 120rpx;
  149. line-height: 120rpx;
  150. font-size: 40rpx;
  151. font-weight: 700;
  152. }
  153. .tip {
  154. margin-left: 10rpx;
  155. width: 64rpx;
  156. height: 30rpx;
  157. color: red;
  158. text-align: right;
  159. font-size: 24rpx;
  160. background-image: url(./icon/new.png);
  161. background-size: 43rpx 30rpx;
  162. background-repeat: no-repeat;
  163. }
  164. }
  165. .inner {
  166. width: 650rpx;
  167. display: flex;
  168. .left {
  169. .user {
  170. image {
  171. width: 90rpx;
  172. height: 90rpx;
  173. border-radius: 50%;
  174. }
  175. }
  176. }
  177. .right {
  178. margin-left: 20rpx;
  179. width: 600rpx;
  180. .name {
  181. margin-top: 5rpx;
  182. font-size: 32rpx;
  183. text {
  184. margin-left: 20rpx;
  185. font-size: 26rpx;
  186. color: #3a3a3a;
  187. }
  188. }
  189. .text {
  190. width: 550rpx;
  191. margin-top: 10rpx;
  192. font-size: 28rpx;
  193. }
  194. .img_box {
  195. margin-top: 20rpx;
  196. width: 550rpx;
  197. overflow: hidden;
  198. .img {
  199. margin-bottom: 10rpx;
  200. float: left;
  201. margin-right: 20rpx;
  202. image {
  203. width: 170rpx;
  204. height: 170rpx;
  205. border-radius: 10rpx;
  206. }
  207. }
  208. .img:nth-child(3n) {
  209. margin-right: 0;
  210. }
  211. }
  212. .time {
  213. margin-top: 20rpx;
  214. font-size: 24rpx;
  215. color: #999999;
  216. }
  217. }
  218. }
  219. .btn {
  220. margin: 20rpx auto;
  221. width: 400rpx;
  222. height: 50rpx;
  223. background-color: #69BBFA;
  224. border-radius: 50rpx;
  225. display: flex;
  226. align-items: center;
  227. justify-content: center;
  228. .icon {
  229. image {
  230. width: 23rpx;
  231. height: 24rpx;
  232. display: block;
  233. }
  234. }
  235. .btn_text {
  236. margin-left: 10rpx;
  237. font-size: 28rpx;
  238. color: #FFFFFF;
  239. }
  240. }
  241. }
  242. }
  243. </style>