t-o-news-tab-1 - 下拉展开式已完成未完成.vue 4.8 KB

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