index.vue 3.2 KB

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