index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="page-index">
  3. <view class="status_bar"></view>
  4. <div class="title">
  5. <text class="tab" :class="type==='user'?'active':''" @click="changeTab('user')">我的</text>
  6. <text class="tab" :class="type==='group'?'active':''" @click="changeTab('group')">部门</text>
  7. </div>
  8. <div class="statistics">
  9. <div class="head">任务统计</div>
  10. <div class="container">
  11. <div class="item">
  12. <img class="icon" src="/static/index/wait.png" alt="">
  13. <text>待巡检{{statistics.wait}}个</text>
  14. </div>
  15. <div class="item">
  16. <img class="icon" src="/static/index/expire.png" alt="">
  17. <text>已逾期{{statistics.expire}}个</text>
  18. </div>
  19. <div class="item">
  20. <img class="icon" src="/static/index/complete.png" alt="">
  21. <text>已完成{{statistics.complete}}个</text>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="task-list">
  26. <div class="head">待办任务</div>
  27. <div class="item" v-for="(item,index) in items" :key="index" @click="linkTo(item)">
  28. <div class="task-title">{{item.taskTitle}}</div>
  29. <div class="time">{{item.expectedStartDate}}-{{item.expectedEndDate}}</div>
  30. </div>
  31. </div>
  32. </view>
  33. </template>
  34. <script>
  35. import {getCheckTaskByList} from '@/api/task.js'
  36. export default {
  37. data() {
  38. return {
  39. statusBarHeight:0,
  40. type:'user',
  41. statistics: {
  42. wait:3,
  43. expire:2,
  44. complete:10
  45. },
  46. items:[]
  47. }
  48. },
  49. onLoad(){
  50. this.initStatusBarHeight()
  51. },
  52. onShow() {
  53. this.init()
  54. },
  55. methods: {
  56. initStatusBarHeight(){
  57. this.statusBarHeight=uni.getSystemInfoSync().statusBarHeight
  58. },
  59. init(){
  60. getCheckTaskByList({
  61. status:0
  62. }).then((res)=>{
  63. this.items=res.data
  64. })
  65. },
  66. changeTab(type){
  67. this.type=type
  68. if(type==='group'){
  69. }else{
  70. }
  71. },
  72. linkTo(item){
  73. uni.setStorageSync('task-item',item)
  74. uni.navigateTo({
  75. url:'/pages/task/task'
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .page-index{
  83. background: linear-gradient(180deg, #4D73FF 0%, rgba(77, 115, 255, 0) 100%);
  84. padding: 0 30upx;
  85. .title{
  86. .tab{
  87. font-size: 34upx;
  88. line-height: 50upx;
  89. margin-right: 32upx;
  90. color: rgba(255, 255, 255, 0.6);
  91. &.active{
  92. color: #fff;
  93. }
  94. }
  95. }
  96. .statistics{
  97. &{
  98. border-radius: 24upx;
  99. background-color: #fff;
  100. padding:36upx 0 44upx 24upx;
  101. margin-top: 48upx;
  102. }
  103. .head{
  104. font-weight: 900;
  105. font-size: 34upx;
  106. line-height: 50upx;
  107. color: #151515;
  108. }
  109. .container{
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. .item{
  114. width: 33.33%;
  115. display: flex;
  116. justify-content: center;
  117. align-items: center;
  118. flex-direction: column;
  119. .icon{
  120. display: block;
  121. width:88upx;
  122. height: 88upx;
  123. }
  124. text{
  125. font-size: 28upx;
  126. line-height: 42upx;
  127. color: #151515;
  128. padding-top: 18upx;
  129. }
  130. }
  131. }
  132. }
  133. .task-list{
  134. border-radius: 24upx;
  135. background-color: #fff;
  136. margin-top: 24upx;
  137. padding: 36upx 24upx;
  138. .head{
  139. font-weight: 900;
  140. font-size: 34upx;
  141. line-height: 50upx;
  142. color: #151515;
  143. }
  144. .item{
  145. padding: 30upx 40upx 38upx 40upx;
  146. .task-title{
  147. color: #212121;
  148. font-size: 32upx;
  149. padding-bottom: 24upx;
  150. }
  151. .time{
  152. background-image: url(/static/index/time.png);
  153. background-repeat: no-repeat;
  154. background-position: left center;
  155. background-size: 24upx 24upx;
  156. padding-left: 36upx;
  157. color: #999;
  158. font-size: 24upx;
  159. }
  160. }
  161. }
  162. }
  163. .container {
  164. padding: 20px;
  165. font-size: 14px;
  166. line-height: 24px;
  167. }
  168. </style>