t-o-news-tab-2 - 大分类备份.vue 6.2 KB

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