index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='智能巡检' 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. </view>
  66. </template>
  67. <script>
  68. import Tabbar from '@/components/CusTabbar/index.vue'
  69. export default {
  70. components:{
  71. Tabbar
  72. },
  73. data(){
  74. return {
  75. orderInfo:{},
  76. deviceInfo:{}
  77. }
  78. },
  79. onShow() {
  80. this.getHomeData();
  81. },
  82. methods:{
  83. getHomeData(){
  84. this.$api.get('/home/homedata').then(res=>{
  85. if(res.data.code===0){
  86. this.orderInfo = res.data.data.workOrder;
  87. this.deviceInfo = res.data.data.equip;
  88. }else this.$showToast(res.data.msg)
  89. })
  90. },
  91. toTurn(url){
  92. if(!url) return
  93. uni.navigateTo({ url })
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped lang="less">
  99. .tabPage{
  100. width: 100%;
  101. padding: 0 24rpx 20rpx;
  102. box-sizing: border-box;
  103. background: #F4F8FB;
  104. .topbg{
  105. width: 100%;
  106. position: fixed;
  107. top: 0;
  108. left: 0;
  109. z-index: 0;
  110. }
  111. .top{
  112. width: 100%;
  113. position: relative;
  114. display: flex;
  115. justify-content: space-between;
  116. margin-top: 20rpx;
  117. .box{
  118. width: calc(50% - 9rpx);
  119. padding: 36rpx 24rpx;
  120. box-sizing: border-box;
  121. background: #FFFFFF;
  122. border-radius: 16rpx;
  123. display: flex;
  124. align-items: center;
  125. image{
  126. width: 98rpx;
  127. height: 98rpx;
  128. }
  129. text{
  130. font-family: PingFang-SC, PingFang-SC;
  131. font-weight: bold;
  132. font-size: 30rpx;
  133. color: #1D2129;
  134. line-height: 28rpx;
  135. text-align: center;
  136. margin-left: 24rpx;
  137. }
  138. }
  139. }
  140. .card{
  141. width: 100%;
  142. position: relative;
  143. background: #FFFFFF;
  144. border-radius: 16rpx;
  145. padding: 36rpx 0 40rpx;
  146. box-sizing: border-box;
  147. margin-top: 20rpx;
  148. .title{
  149. width: 100%;
  150. padding: 0 24rpx;
  151. box-sizing: border-box;
  152. display: flex;
  153. align-items: center;
  154. justify-content: space-between;
  155. .left{
  156. font-family: PingFang-SC, PingFang-SC;
  157. font-weight: bold;
  158. font-size: 36rpx;
  159. color: #333333;
  160. line-height: 36rpx;
  161. text-align: left;
  162. }
  163. .right{
  164. display: flex;
  165. align-content: center;
  166. text {
  167. font-family: PingFangSC, PingFang SC;
  168. font-weight: 400;
  169. font-size: 26rpx;
  170. color: #198CFF;
  171. line-height: 28rpx;
  172. text-align: left;
  173. }
  174. }
  175. }
  176. .info{
  177. width: 100%;
  178. margin-top: 64rpx;
  179. display: flex;
  180. .pre{
  181. width: calc(100% / 3);
  182. display: flex;
  183. flex-direction: column;
  184. align-items: center;
  185. text{
  186. font-family: PingFang-SC, PingFang-SC;
  187. font-weight: bold;
  188. font-size: 36rpx;
  189. color: #333333;
  190. line-height: 36rpx;
  191. }
  192. p{
  193. font-family: PingFangSC, PingFang SC;
  194. font-weight: 400;
  195. font-size: 28rpx;
  196. color: #999999;
  197. line-height: 28rpx;
  198. text-align: center;
  199. margin-top: 20rpx;
  200. }
  201. }
  202. &.device .pre{
  203. width: 25%;
  204. }
  205. }
  206. }
  207. }
  208. </style>