index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view>
  3. <u-navbar :title="title" :is-back="0" ></u-navbar>
  4. <view class="main">
  5. <view class="list">
  6. <view class="line" v-for="(item,i) in list" :key="i"
  7. @click="gotoUrl('/pages/deviceTab/deviceList?parkingId='+item.id)" >
  8. <view class="body">
  9. <view class="imgclass">
  10. <image class="img" src="@/assets/img/deviceTab/index1-1.svg" mode=""></image>
  11. </view>
  12. <view class="item">
  13. <view class="name">
  14. {{item.name}}
  15. </view>
  16. <view class="value" >
  17. <!-- 占用{{item.useNum}}<span>/</span>
  18. 空闲{{item.idleNum}}<span>/</span>
  19. 错误{{item.errorNum}}<span>/</span>
  20. 共{{item.lockNum}}台 -->
  21. <span>{{item.contacts}}</span>
  22. <span>{{item.openStatusN}}</span>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="goto">
  27. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  33. <tabbar :current="1"></tabbar>
  34. </view>
  35. </template>
  36. <script>
  37. import * as API from '@/apis/pagejs/deviceTab.js'
  38. import Tabbar from '@/components/Tabbar.vue'
  39. export default {
  40. components: {
  41. Tabbar
  42. },
  43. data() {
  44. return {
  45. title:"场站列表",
  46. list:[],
  47. listForm:{
  48. pageIndex: 1,
  49. pageSize: 20,
  50. recordsTotal: 1,
  51. },
  52. };
  53. },
  54. onLoad() {
  55. this.getList()
  56. },
  57. onReachBottom() {
  58. if (this.list.length < this.listForm.recordsTotal) {
  59. this.myLoadmore();
  60. }
  61. },
  62. methods: {
  63. myLoadmore(){
  64. this.listForm.pageIndex += 1;
  65. this.getList()
  66. },
  67. getList() {
  68. uni.showLoading({
  69. title: "加载中",
  70. mask: true,
  71. })
  72. API.parkingList(this.listForm).then((res) => {
  73. var list=this.list
  74. if (this.listForm.pageIndex == 1) {
  75. list = res.data.parkingInfoList;
  76. } else {
  77. list = [
  78. ...list,
  79. ...res.data.parkingInfoList
  80. ];
  81. }
  82. this.list=list
  83. uni.hideLoading();
  84. }).catch(error => {
  85. uni.hideLoading();
  86. uni.showToast({
  87. title: error,
  88. icon: "none"
  89. })
  90. })
  91. },
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. .main{
  97. background-color: #fff;
  98. .line{
  99. display: flex;
  100. justify-content: space-between;
  101. align-items: center;
  102. padding: 32rpx;
  103. border-bottom: 1px solid rgba(245,245,245,1);
  104. .body{
  105. display: flex;
  106. align-items: center;
  107. .imgclass{
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. width: 72rpx;
  112. height: 72rpx;
  113. border-radius: 4px;
  114. background-color: rgba(219,234,255,1);
  115. }
  116. .item{
  117. margin-left: 16rpx;
  118. .name{
  119. color: rgba(51,51,51,1);
  120. font-size: 28rpx;
  121. }
  122. .value{
  123. color: rgba(119,119,119,1);
  124. font-size: 24rpx;
  125. span{
  126. margin-right: 16rpx;
  127. }
  128. }
  129. }
  130. }
  131. }
  132. .img{
  133. width: 48rpx;
  134. height: 48rpx;
  135. }
  136. }
  137. </style>