index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='智能巡检' :showback='false' bgColor='transparent'></cus-header>
  4. <image class="topbg" :src="imgBase+'inspection/inspection_top_bg.png'" mode="widthFix"></image>
  5. <div class="top">
  6. <div class="box" @tap="toTurn('/pagesInspection/onlineRepair/index')">
  7. <image :src="imgBase+'inspection/inspection_img_xsbx.png'"></image>
  8. <text>线上报修</text>
  9. </div>
  10. <div class="box" @tap="toTurn('/pagesInspection/record/index')">
  11. <image :src="imgBase+'inspection/inspection_img_xjjl.png'"></image>
  12. <text>巡检记录</text>
  13. </div>
  14. </div>
  15. <div class="card">
  16. <div class="title" @tap="toTurn('/pagesInspection/waitOrder/index')">
  17. <div class="left">工单待办</div>
  18. <div class="right">
  19. <text>立即查看</text>
  20. <u-icon name="arrow-right" color="#198CFF" size="28"></u-icon>
  21. </div>
  22. </div>
  23. <div class="info">
  24. <div class="pre">
  25. <text>{{orderInfo[1]||0}}</text>
  26. <p>待指派</p>
  27. </div>
  28. <div class="pre">
  29. <text>{{orderInfo[2]||0}}</text>
  30. <p>待维修</p>
  31. </div>
  32. <div class="pre">
  33. <text>{{orderInfo[3]||0}}</text>
  34. <p>已维修</p>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="card">
  39. <div class="title" @tap="toTurn('/pagesInspection/abnormalDevice/index')">
  40. <div class="left">设备异常</div>
  41. <div class="right">
  42. <text>立即查看</text>
  43. <u-icon name="arrow-right" color="#198CFF" size="28"></u-icon>
  44. </div>
  45. </div>
  46. <div class="info device">
  47. <div class="pre">
  48. <text>{{deviceInfo.abnormalNum||0}}</text>
  49. <p>异常总数</p>
  50. </div>
  51. <div class="pre">
  52. <text>{{deviceInfo.maps.AirConditioner||0}}</text>
  53. <p>空调异常</p>
  54. </div>
  55. <div class="pre">
  56. <text>{{deviceInfo.maps.WaterMeter||0}}</text>
  57. <p>水表异常</p>
  58. </div>
  59. <div class="pre">
  60. <text>{{deviceInfo.maps.Relay||0}}</text>
  61. <p>电表异常</p>
  62. </div>
  63. </div>
  64. </div>
  65. <Tabbar :tabbarIndex="1"></Tabbar>
  66. </view>
  67. </template>
  68. <script>
  69. import Tabbar from '@/components/CusTabbar/index.vue'
  70. export default {
  71. components:{
  72. Tabbar
  73. },
  74. data(){
  75. return {
  76. orderInfo:{},
  77. deviceInfo:{}
  78. }
  79. },
  80. onShow() {
  81. this.getHomeData();
  82. },
  83. methods:{
  84. getHomeData(){
  85. this.$api.get('/home/homedata').then(res=>{
  86. if(res.data.code===0){
  87. this.orderInfo = res.data.data.workOrder;
  88. this.deviceInfo = res.data.data.equip;
  89. }else this.$showToast(res.data.msg)
  90. })
  91. },
  92. toTurn(url){
  93. if(!url) return
  94. uni.navigateTo({ url })
  95. }
  96. }
  97. }
  98. </script>
  99. <style scoped lang="less">
  100. .tabPage{
  101. width: 100%;
  102. padding: 0 24rpx 188rpx;
  103. box-sizing: border-box;
  104. background: #F4F8FB;
  105. .topbg{
  106. width: 100%;
  107. position: fixed;
  108. top: 0;
  109. left: 0;
  110. z-index: 0;
  111. }
  112. .top{
  113. width: 100%;
  114. position: relative;
  115. display: flex;
  116. justify-content: space-between;
  117. margin-top: 20rpx;
  118. .box{
  119. width: calc(50% - 9rpx);
  120. padding: 36rpx 24rpx;
  121. box-sizing: border-box;
  122. background: #FFFFFF;
  123. border-radius: 16rpx;
  124. display: flex;
  125. align-items: center;
  126. image{
  127. width: 98rpx;
  128. height: 98rpx;
  129. }
  130. text{
  131. font-family: PingFang-SC, PingFang-SC;
  132. font-weight: bold;
  133. font-size: 30rpx;
  134. color: #1D2129;
  135. line-height: 28rpx;
  136. text-align: center;
  137. margin-left: 24rpx;
  138. }
  139. }
  140. }
  141. .card{
  142. width: 100%;
  143. position: relative;
  144. background: #FFFFFF;
  145. border-radius: 16rpx;
  146. padding: 36rpx 0 40rpx;
  147. box-sizing: border-box;
  148. margin-top: 20rpx;
  149. .title{
  150. width: 100%;
  151. padding: 0 24rpx;
  152. box-sizing: border-box;
  153. display: flex;
  154. align-items: center;
  155. justify-content: space-between;
  156. .left{
  157. font-family: PingFang-SC, PingFang-SC;
  158. font-weight: bold;
  159. font-size: 36rpx;
  160. color: #333333;
  161. line-height: 36rpx;
  162. text-align: left;
  163. }
  164. .right{
  165. display: flex;
  166. align-content: center;
  167. text {
  168. font-family: PingFangSC, PingFang SC;
  169. font-weight: 400;
  170. font-size: 26rpx;
  171. color: #198CFF;
  172. line-height: 28rpx;
  173. text-align: left;
  174. }
  175. }
  176. }
  177. .info{
  178. width: 100%;
  179. margin-top: 64rpx;
  180. display: flex;
  181. .pre{
  182. width: calc(100% / 3);
  183. display: flex;
  184. flex-direction: column;
  185. align-items: center;
  186. text{
  187. font-family: PingFang-SC, PingFang-SC;
  188. font-weight: bold;
  189. font-size: 36rpx;
  190. color: #333333;
  191. line-height: 36rpx;
  192. }
  193. p{
  194. font-family: PingFangSC, PingFang SC;
  195. font-weight: 400;
  196. font-size: 28rpx;
  197. color: #999999;
  198. line-height: 28rpx;
  199. text-align: center;
  200. margin-top: 20rpx;
  201. }
  202. }
  203. &.device .pre{
  204. width: 25%;
  205. }
  206. }
  207. }
  208. }
  209. </style>