index.vue 3.4 KB

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