home.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template>
  2. <!-- 开启顶部安全区适配 -->
  3. <van-nav-bar
  4. :border="false"
  5. safe-area-inset-top
  6. style="background-color: #5c8fff"
  7. />
  8. <div class="page_info">
  9. <div class="info_bg">
  10. <van-row align="center" class="title">
  11. <van-col>
  12. <van-image
  13. :src="require('@/assets/position.svg')"
  14. width="16"
  15. height="16"
  16. fit="contain"
  17. />
  18. <van-col>{{ name }}</van-col>
  19. <van-image
  20. :src="require('@/assets/arrow-right.svg')"
  21. width="24"
  22. height="24"
  23. fit="contain"
  24. />
  25. </van-col>
  26. <van-col @click="toPath">
  27. <van-image
  28. :src="require('@/assets/user.svg')"
  29. width="16"
  30. height="16"
  31. fit="contain"
  32. />
  33. </van-col>
  34. </van-row>
  35. </div>
  36. <!-- 维修工没有此块功能 -->
  37. <template v-if="role != 3">
  38. <div class="info_function">
  39. <div
  40. class="function_item"
  41. v-for="(item, index) in functionList"
  42. :key="index"
  43. :style="{ display: !item.role.includes(role) ? 'none' : '' }"
  44. >
  45. <template v-if="item.role.includes(role)">
  46. <van-image :src="item.src" width="36" height="36" fit="contain" />
  47. <van-col>{{ item.label }}</van-col>
  48. </template>
  49. </div>
  50. </div>
  51. </template>
  52. <div class="info_list">
  53. <!-- 实时巡检begin -->
  54. <van-row align="center" justify="space-between" class="sub_title">
  55. <van-col class="title">实时巡检</van-col>
  56. <van-col class="function_btn">
  57. <van-col>立即巡检</van-col>
  58. <van-image
  59. :src="require('@/assets/btn-arrow-right.svg')"
  60. width="24"
  61. height="24"
  62. fit="contain"
  63. />
  64. </van-col>
  65. </van-row>
  66. <van-row align="center" justify="space-between" class="list_item">
  67. <van-row
  68. align="center"
  69. justify="space-between"
  70. style="flex-direction: column"
  71. v-for="(item, index) in checkList"
  72. :key="item + '_' + index"
  73. >
  74. <van-col>{{ item.label }}</van-col>
  75. <v-count-up
  76. :end-val="Number(item['count'])"
  77. class="count_up"
  78. :options="item['options']"
  79. />
  80. </van-row>
  81. </van-row>
  82. <!-- 实时巡检end -->
  83. <!-- 工单待办begin -->
  84. <van-row align="center" justify="space-between" class="sub_title">
  85. <van-col class="title">工单待办</van-col>
  86. <van-col class="function_btn">
  87. <van-col>立即处理</van-col>
  88. <van-image
  89. :src="require('@/assets/btn-arrow-right.svg')"
  90. width="24"
  91. height="24"
  92. fit="contain"
  93. />
  94. </van-col>
  95. </van-row>
  96. <van-row align="center" justify="space-between" class="list_item">
  97. <van-row
  98. align="center"
  99. justify="space-between"
  100. style="flex-direction: column"
  101. v-for="(item, index) in workList"
  102. :key="item + '_' + index"
  103. >
  104. <van-col>{{ item.label }}</van-col>
  105. <v-count-up
  106. :end-val="Number(item['count'])"
  107. class="count_up"
  108. :options="item['options']"
  109. />
  110. </van-row>
  111. </van-row>
  112. <!-- 工单待办end -->
  113. <!-- 设备异常begin -->
  114. <van-row align="center" justify="space-between" class="sub_title">
  115. <van-col class="title">设备异常</van-col>
  116. <van-col class="function_btn">
  117. <van-col>立即处理</van-col>
  118. <van-image
  119. :src="require('@/assets/btn-arrow-right.svg')"
  120. width="24"
  121. height="24"
  122. fit="contain"
  123. />
  124. </van-col>
  125. </van-row>
  126. <van-row align="center" justify="space-between" class="list_item">
  127. <van-row
  128. align="center"
  129. justify="space-between"
  130. style="flex-direction: column"
  131. v-for="(item, index) in deviceErrorList"
  132. :key="item + '-' + index"
  133. >
  134. <van-col>{{ item.label }}</van-col>
  135. <v-count-up
  136. :end-val="Number(item['count'])"
  137. class="count_up"
  138. :options="item['options']"
  139. style="color: #fa5555"
  140. />
  141. </van-row>
  142. </van-row>
  143. <!-- 设备异常end -->
  144. <!-- 欠费待收begin -->
  145. <van-row align="center" justify="space-between" class="sub_title">
  146. <van-col class="title">欠费待收</van-col>
  147. <van-col class="function_btn">
  148. <van-col>立即处理</van-col>
  149. <van-image
  150. :src="require('@/assets/btn-arrow-right.svg')"
  151. width="24"
  152. height="24"
  153. fit="contain"
  154. />
  155. </van-col>
  156. </van-row>
  157. <div class="list_item list_table">
  158. <van-row align="center" justify="space-between" class="table_header">
  159. <van-col span="8">欠费类型</van-col>
  160. <van-col span="8">欠费租户数</van-col>
  161. <van-col span="8">累计欠费</van-col>
  162. </van-row>
  163. <van-row
  164. align="center"
  165. justify="space-between"
  166. v-for="item in list"
  167. :key="item.id"
  168. class="table_body"
  169. >
  170. <van-col span="8" style="color: #999999; font-size: 12px">
  171. {{ `${feeType_filter(item && item.feeType)}` }}
  172. </van-col>
  173. <van-col span="8" style="color: #0c1935; font-size: 16px">
  174. {{ item.rentNum }}
  175. </van-col>
  176. <van-col span="8" style="color: #0c1935; font-size: 16px">
  177. {{ item.totalFee }}
  178. </van-col>
  179. </van-row>
  180. </div>
  181. <!-- 欠费待收end -->
  182. </div>
  183. </div>
  184. <!-- 底部tabbar -->
  185. <van-tabbar
  186. v-model="activeTabBar"
  187. active-color="#2E69EB"
  188. inactive-color="#0c1935"
  189. safe-area-inset-bottom
  190. >
  191. <van-tabbar-item
  192. name="home"
  193. :icon="
  194. activeTabBar == 'home'
  195. ? require('@/assets/home-active.svg')
  196. : require('@/assets/home.svg')
  197. "
  198. to="/home"
  199. >首页</van-tabbar-item
  200. >
  201. <van-tabbar-item
  202. name="rentBill"
  203. :icon="
  204. activeTabBar == 'rentBill'
  205. ? require('@/assets/rent-bill-active.svg')
  206. : require('@/assets/rent-bill.svg')
  207. "
  208. to="/rentBill"
  209. >租户账单</van-tabbar-item
  210. >
  211. <van-tabbar-item
  212. name="remoteControl"
  213. :icon="
  214. activeTabBar == 'remoteControl'
  215. ? require('@/assets/remote-control-active.svg')
  216. : require('@/assets/remote-control.svg')
  217. "
  218. to="/remoteControl"
  219. >远程管控</van-tabbar-item
  220. >
  221. </van-tabbar>
  222. </template>
  223. <script>
  224. import { isEmpty } from "@/utils/index.js";
  225. import VCountUp from "./CountUp";
  226. export default {
  227. components: {
  228. "v-count-up": VCountUp,
  229. },
  230. data() {
  231. return {
  232. role: 1, //1:admin、2:巡检人员、3:维修工、4:租户
  233. name: "电商园四期-B座",
  234. activeTabBar: "home",
  235. functionList: [
  236. {
  237. src: require("@/assets/repair-online.svg"),
  238. label: "线上报修",
  239. role: [1, 2, 4],
  240. },
  241. {
  242. src: require("@/assets/check-review.svg"),
  243. label: "巡检记录",
  244. role: [1, 2],
  245. },
  246. {
  247. src: require("@/assets/reduce-record.svg"),
  248. label: "扣缴记录",
  249. role: [1, 4],
  250. },
  251. ],
  252. checkList: [
  253. {
  254. label: "今日待巡检",
  255. count: 88,
  256. options: {
  257. separator: ",",
  258. },
  259. },
  260. {
  261. label: "今日已巡检",
  262. count: 2,
  263. options: {
  264. separator: ",",
  265. },
  266. },
  267. ],
  268. workList: [
  269. {
  270. label: "待指派",
  271. count: 3,
  272. options: {
  273. separator: ",",
  274. },
  275. },
  276. {
  277. label: "待维修",
  278. count: 2,
  279. options: {
  280. separator: ",",
  281. },
  282. },
  283. {
  284. label: "已维修",
  285. count: 1,
  286. options: {
  287. separator: ",",
  288. },
  289. },
  290. ],
  291. deviceErrorList: [
  292. {
  293. label: "异常总数",
  294. count: 7,
  295. options: {
  296. separator: ",",
  297. },
  298. },
  299. {
  300. label: "电表异常",
  301. count: 5,
  302. options: {
  303. separator: ",",
  304. },
  305. },
  306. {
  307. label: "水表异常",
  308. count: 2,
  309. options: {
  310. separator: ",",
  311. },
  312. },
  313. ],
  314. list: [
  315. { feeType: 1, rentNum: 23, totalFee: 12636 },
  316. { feeType: 2, rentNum: 7, totalFee: 462 },
  317. { feeType: 3, rentNum: 132, totalFee: 24634 },
  318. { feeType: 1, rentNum: 23, totalFee: 12636 },
  319. { feeType: 2, rentNum: 7, totalFee: 462 },
  320. { feeType: 3, rentNum: 132, totalFee: 24634 },
  321. ],
  322. };
  323. },
  324. methods: {
  325. feeType_filter(val) {
  326. if (isEmpty(val)) {
  327. return "";
  328. }
  329. if (val == 1) {
  330. return "电费";
  331. }
  332. if (val == 2) {
  333. return "水费";
  334. }
  335. if (val == 3) {
  336. return "物业相关";
  337. }
  338. },
  339. toPath() {
  340. this.$router.push({
  341. path: "/userInfo",
  342. query: {
  343. title: "账号中心",
  344. source: "account",
  345. },
  346. });
  347. },
  348. },
  349. };
  350. </script>
  351. <style lang="scss" scoped>
  352. .page_info {
  353. position: relative;
  354. height: calc(
  355. 100% - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 50px -46px
  356. );
  357. .info_bg {
  358. width: 100%;
  359. height: 102px;
  360. background: #5c8fff;
  361. border-radius: 0px 0px 16px 16px;
  362. padding-top: 12px;
  363. margin-bottom: 42px;
  364. box-sizing: border-box;
  365. .title {
  366. display: flex;
  367. align-items: center;
  368. justify-content: space-between;
  369. padding: 0 16px;
  370. .van-col {
  371. height: 24px;
  372. font-size: 16px;
  373. font-weight: 600;
  374. color: #ffffff;
  375. line-height: 24px;
  376. text-indent: 4px;
  377. text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04);
  378. display: flex;
  379. align-items: center;
  380. letter-spacing: 2px;
  381. }
  382. }
  383. }
  384. .info_function {
  385. position: absolute;
  386. top: 52px;
  387. width: calc(100% - 32px);
  388. margin: 0 16px;
  389. background: #ffffff;
  390. box-shadow: 0px 0px 8px 0px rgba(51, 51, 51, 0.08);
  391. border-radius: 4px;
  392. display: flex;
  393. align-items: center;
  394. justify-content: space-around;
  395. padding: 16px 0;
  396. .function_item {
  397. display: flex;
  398. flex-direction: column;
  399. align-items: center;
  400. justify-content: center;
  401. .van-col {
  402. height: 20px;
  403. font-size: 14px;
  404. font-weight: 400;
  405. color: #666666;
  406. line-height: 20px;
  407. margin-top: 4px;
  408. }
  409. }
  410. }
  411. .info_list {
  412. max-height: calc(100% - 102px - 42px - 20px);
  413. padding: 0 16px;
  414. overflow-y: auto;
  415. .sub_title {
  416. margin: 12px 0 6px 0;
  417. .title {
  418. height: 20px;
  419. font-size: 14px;
  420. font-weight: 500;
  421. color: #0c1935;
  422. line-height: 20px;
  423. }
  424. .function_btn {
  425. display: flex;
  426. align-items: center;
  427. .van-col {
  428. height: 16px;
  429. font-size: 12px;
  430. font-weight: 400;
  431. color: #2e69eb;
  432. line-height: 16px;
  433. }
  434. }
  435. }
  436. .list_item {
  437. background: #ffffff;
  438. box-shadow: 0px 0px 4px 0px rgba(51, 51, 51, 0.08);
  439. border-radius: 4px;
  440. padding: 16px 30px;
  441. .van-col {
  442. height: 16px;
  443. font-size: 12px;
  444. font-weight: 400;
  445. color: #666666;
  446. line-height: 16px;
  447. }
  448. .count_up {
  449. margin-top: 4px;
  450. height: 22px;
  451. font-size: 20px;
  452. font-weight: 500;
  453. color: #0c1935;
  454. line-height: 22px;
  455. }
  456. }
  457. .list_table {
  458. padding: 8px 16px;
  459. .table_header {
  460. padding: 8px 0;
  461. border-bottom: 1px solid #eeeeee;
  462. .van-col {
  463. height: 16px;
  464. font-size: 12px;
  465. font-weight: 600;
  466. color: #999999;
  467. line-height: 16px;
  468. }
  469. }
  470. .table_body {
  471. padding: 12px 0;
  472. border-bottom: 1px solid #eeeeee;
  473. }
  474. }
  475. }
  476. }
  477. </style>