index.vue 3.0 KB

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