gateDetails.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="details">
  3. <z-paging ref="paging" v-model="list" @query="queryList">
  4. <view class="details-tabs" slot="top">
  5. <u-tabs :list="tabList" @click="tabClick" lineWidth="40"></u-tabs>
  6. </view>
  7. <view class="details-total" slot="top">
  8. <view>已停车位:{{ 30 }}个;空余车位:{{ 36 }}个</view>
  9. </view>
  10. <view class="details-list">
  11. <view class="details-list-item" v-for="(item, index) in list" :key="index" @click="jumpPage('pages/index/deviceDetails/deviceDetails', { type: 3 })">
  12. <view class="details-list-item-header">
  13. <view>{{ item.roadNo }}</view>
  14. <view>{{ item.signal }}</view>
  15. </view>
  16. <view class="details-list-item-img">
  17. <u--image v-if="item.type === 1" src="../../../static/icons/daozhakongzhi.svg" width="174rpx" height="174rpx"></u--image>
  18. <u--image v-else-if="item.type === 2" src="../../../static/icons/shipinjiankongyemian.svg" width="174rpx" height="174rpx"></u--image>
  19. <u--image v-else-if="item.type === 3" src="../../../static/icons/chengguan-wu-bujian-gonggongsheshi-daoluxinxixianshiping.svg" width="174rpx" height="174rpx"></u--image>
  20. </view>
  21. <view class="details-list-item-bottom">
  22. <view>设备号{{ item.deviceNo }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </z-paging>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. roadInfo: {
  34. roadName: ''
  35. },
  36. tabList: [{
  37. name: '全部',
  38. value: ''
  39. },
  40. {
  41. name: '异常',
  42. value: 1
  43. },
  44. {
  45. name: '离线',
  46. value: 2
  47. }
  48. ],
  49. list: []
  50. }
  51. },
  52. onLoad(page) {
  53. if (page.roadName) {
  54. this.roadInfo.roadName = page.roadName
  55. uni.setNavigationBarTitle({
  56. title: page.roadName
  57. })
  58. }
  59. },
  60. methods: {
  61. queryList(pageNo, pageSize) {
  62. this.$refs.paging.complete([{
  63. roadNo: '入口道闸',
  64. signal: '降板',
  65. type: 1,
  66. deviceNo: '202103051265',
  67. electric: 9.9
  68. }, {
  69. roadNo: '入口车牌识别',
  70. signal: '在线',
  71. type: 2,
  72. deviceNo: '202103051265',
  73. electric: 10
  74. }, {
  75. roadNo: '入口显示屏',
  76. signal: '在线',
  77. type: 3,
  78. deviceNo: '202103051265',
  79. electric: 10
  80. }])
  81. },
  82. tabClick(val) {
  83. console.log(val)
  84. },
  85. getTimeLong(date) {
  86. const nowDate = (new Date()).valueOf()
  87. const curDate = (new Date(date)).valueOf()
  88. const timeLen = (nowDate - curDate) / 1000
  89. const day = parseInt(timeLen / (24 * 3600));
  90. const hour = parseInt((timeLen - day * 24 * 3600) / 3600);
  91. const minutes = parseInt((timeLen - day * 24 * 3600 - hour * 3600) / 60)
  92. const second = parseInt(timeLen % 60)
  93. return `${day}天${hour}时${minutes}分${second}秒`
  94. },
  95. jumpPage(url, params) {
  96. uni.$u.route({
  97. url, params
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. page {
  105. min-height: calc(100vh - 88rpx);
  106. background-color: #F6F6FF;
  107. }
  108. .details {
  109. font-family: 'PingFangSC-regular';
  110. &-tabs {
  111. background-color: #fff;
  112. }
  113. &-total {
  114. display: flex;
  115. justify-content: flex-end;
  116. margin-top: 32rpx;
  117. font-size: 26rpx;
  118. color: #000;
  119. padding-right: 20rpx;
  120. }
  121. &-list {
  122. padding: 40rpx 20rpx;
  123. display: flex;
  124. justify-content: space-between;
  125. flex-wrap: wrap;
  126. &-item {
  127. width: calc(50% - 52rpx);
  128. background-color: #fff;
  129. border-radius: 16rpx;
  130. padding: 20rpx;
  131. margin-bottom: 20rpx;
  132. &-header {
  133. display: flex;
  134. justify-content: space-between;
  135. color: #101010;
  136. font-size: 26rpx;
  137. }
  138. &-img {
  139. width: 152rpx;
  140. height: 152rpx;
  141. margin: 16rpx auto 46rpx;
  142. }
  143. &-bottom {
  144. text-align: center;
  145. font-size: 24rpx;
  146. color: #101010;
  147. }
  148. }
  149. }
  150. }
  151. </style>