index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.title}}</div>
  29. <div class="time">{{item.time}}</div>
  30. </div>
  31. </div>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. statusBarHeight:0,
  39. type:'user',
  40. statistics: {
  41. wait:3,
  42. expire:2,
  43. complete:10
  44. },
  45. items:[]
  46. }
  47. },
  48. onLoad(){
  49. this.initStatusBarHeight()
  50. },
  51. onShow() {
  52. this.init()
  53. },
  54. methods: {
  55. initStatusBarHeight(){
  56. this.statusBarHeight=uni.getSystemInfoSync().statusBarHeight
  57. },
  58. init(){
  59. const items=[]
  60. for(let i=0;i<10;i++){
  61. items.push({
  62. title:'{2号-770-32002}:采空区封堵完好,无渗水情况。' ,
  63. time:'2022-02-03 09:00'
  64. })
  65. }
  66. this.items=items
  67. },
  68. changeTab(type){
  69. this.type=type
  70. if(type==='group'){
  71. }else{
  72. }
  73. },
  74. linkTo(item){
  75. uni.setStorageSync('task-item',item)
  76. uni.navigateTo({
  77. url:'/pages/task/task'
  78. })
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .page-index{
  85. background: linear-gradient(180deg, #4D73FF 0%, rgba(77, 115, 255, 0) 100%);
  86. padding: 0 30upx;
  87. .title{
  88. .tab{
  89. font-size: 34upx;
  90. line-height: 50upx;
  91. margin-right: 32upx;
  92. color: rgba(255, 255, 255, 0.6);
  93. &.active{
  94. color: #fff;
  95. }
  96. }
  97. }
  98. .statistics{
  99. &{
  100. border-radius: 24upx;
  101. background-color: #fff;
  102. padding:36upx 0 44upx 24upx;
  103. margin-top: 48upx;
  104. }
  105. .head{
  106. font-weight: 900;
  107. font-size: 34upx;
  108. line-height: 50upx;
  109. color: #151515;
  110. }
  111. .container{
  112. display: flex;
  113. justify-content: center;
  114. align-items: center;
  115. .item{
  116. width: 33.33%;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. flex-direction: column;
  121. .icon{
  122. display: block;
  123. width:88upx;
  124. height: 88upx;
  125. }
  126. text{
  127. font-size: 28upx;
  128. line-height: 42upx;
  129. color: #151515;
  130. padding-top: 18upx;
  131. }
  132. }
  133. }
  134. }
  135. .task-list{
  136. border-radius: 24upx;
  137. background-color: #fff;
  138. margin-top: 24upx;
  139. padding: 36upx 24upx;
  140. .head{
  141. font-weight: 900;
  142. font-size: 34upx;
  143. line-height: 50upx;
  144. color: #151515;
  145. }
  146. .item{
  147. padding: 30upx 40upx 38upx 40upx;
  148. .task-title{
  149. color: #212121;
  150. font-size: 32upx;
  151. padding-bottom: 24upx;
  152. }
  153. .time{
  154. background-image: url(/static/index/time.png);
  155. background-repeat: no-repeat;
  156. background-position: left center;
  157. background-size: 24upx 24upx;
  158. padding-left: 36upx;
  159. color: #999;
  160. font-size: 24upx;
  161. }
  162. }
  163. }
  164. }
  165. .container {
  166. padding: 20px;
  167. font-size: 14px;
  168. line-height: 24px;
  169. }
  170. </style>