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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="item" v-for="(item,index) in list" :key="index">
  5. <view class="label" @click="change_active(index)">
  6. <view class="left">
  7. <view class="icon">
  8. <image src="./icon/icon.png" mode=""></image>
  9. </view>
  10. <view class="name">{{item.category}}</view>
  11. </view>
  12. <view class="right">
  13. <view class="tip" v-if="active != index && item.no_num != 0">
  14. <view class="tip_text">未处理</view>
  15. <view class="tip_num">{{item.no_num}}</view>
  16. </view>
  17. <view class="icon" v-if="active != index">
  18. <uni-icons type="bottom" size="20" color="#e5e5e5"></uni-icons>
  19. </view>
  20. <view class="icon" v-if="active == index">
  21. <uni-icons type="top" size="20" color="#e5e5e5"></uni-icons>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="content" v-if="active == index">
  26. <view class="item" v-for="(item_2,index_2) in item.children" :key="index_2">
  27. <view class="title">
  28. <view class="icon"></view>
  29. <view class="text">{{item_2.title}}</view>
  30. </view>
  31. <view class="btn_box">
  32. <view class="btn" @click.stop="go_list(item_2.title,item_2.table,item_2.num,2)">
  33. <view class="text">未完成:<text>{{item_2.series[1].value}} 个</text></view>
  34. </view>
  35. <view class="btn" @click.stop="go_statistical_chart(item_2.title,item_2.table)">
  36. <view class="text">查看统计</text></view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. name: "t-o-news-tab-1",
  48. data() {
  49. return {
  50. active:999,
  51. list:[]
  52. };
  53. },
  54. mounted() {
  55. this.get_data()
  56. },
  57. methods:{
  58. change_active(index) {
  59. console.log(index)
  60. if(this.active == index){
  61. this.active = 999
  62. }else{
  63. this.active = index
  64. }
  65. },
  66. get_data(){
  67. this.$api.five_fixed_fiveFixedNewCategory({
  68. }).then((res)=>{
  69. // console.log(res.data.content.data)
  70. this.list = res.data.content.data
  71. // 设置提醒角标
  72. // let num = 0
  73. // this.list.forEach((item,index)=>{
  74. // num = num + item.no_num
  75. // })
  76. // if(num > 0){
  77. // uni.setTabBarBadge({
  78. // index: 1,
  79. // text: '' + num + ''
  80. // })
  81. // }
  82. })
  83. },
  84. go_list(title,table,num,status){
  85. console.log(title,table,num,status)
  86. uni.navigateTo({
  87. url: "../../origanization/news/tab_1/all_list/all_list?title=" + title + "&table=" + table + "&num=" + num + "&status=" + status
  88. })
  89. },
  90. // 统计详情
  91. go_statistical_chart(title,table){
  92. uni.navigateTo({
  93. url:"../../origanization/news/tab_1/statistical_chart/statistical_chart?title=" + title + "&table=" + table
  94. })
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. .list{
  101. box-sizing: border-box;
  102. padding: 25rpx;
  103. .item{
  104. margin-bottom: 20rpx;
  105. background-color: #FFFFFF;
  106. border-radius: 10rpx;
  107. .label{
  108. box-sizing: border-box;
  109. padding: 0 25rpx;
  110. display: flex;
  111. align-items: center;
  112. justify-content: space-between;
  113. height: 100rpx;
  114. .left{
  115. display: flex;
  116. align-items: center;
  117. .icon{
  118. margin-right: 20rpx;
  119. image{
  120. width: 32rpx;
  121. height: 32rpx;
  122. display: block;
  123. }
  124. }
  125. .name{
  126. width: 300rpx;
  127. white-space: nowrap;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. }
  131. }
  132. .right{
  133. display: flex;
  134. .tip{
  135. display: flex;
  136. align-items: center;
  137. .tip_text{
  138. font-size: 26rpx;
  139. color: #FE6A5C;
  140. }
  141. .tip_num{
  142. margin: 0 20rpx;
  143. font-size: 28rpx;
  144. color: #FFFFFF;
  145. background-color: #FE6A5C;
  146. border-radius: 10rpx;
  147. padding: 2rpx 10rpx;
  148. }
  149. }
  150. .icon{
  151. }
  152. }
  153. }
  154. .content{
  155. background-color: #FFFFFF;
  156. box-sizing: border-box;
  157. padding: 0 25rpx 10rpx;
  158. .item{
  159. border-top: 2rpx dashed #DCDCDC;
  160. .title{
  161. margin-left: 20rpx;
  162. display: flex;
  163. align-items: center;
  164. height: 90rpx;
  165. .icon{
  166. width: 16rpx;
  167. height: 16rpx;
  168. background-color: #01A0E8;
  169. border-radius: 50%;
  170. }
  171. .text{
  172. margin-left: 20rpx;
  173. font-size: 30rpx;
  174. font-weight: 700;
  175. }
  176. }
  177. .btn_box{
  178. display: flex;
  179. justify-content: space-around;
  180. .btn{
  181. width: 200rpx;
  182. text-align: center;
  183. color: #999999;
  184. font-size: 28rpx;
  185. padding: 6rpx 20rpx;
  186. border: 1rpx solid #999;
  187. border-radius: 30rpx;
  188. text{
  189. color: #FE6A5C;
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. </style>