123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <view>
- <u-navbar :title="title" :is-back="0" ></u-navbar>
- <view class="main">
- <view class="list">
- <view class="line" v-for="(item,i) in list" :key="i"
- @click="gotoUrl('/pages/deviceTab/deviceList?parkingId='+item.id)" >
- <view class="body">
- <view class="imgclass">
- <image class="img" src="@/assets/img/deviceTab/index1-1.svg" mode=""></image>
- </view>
- <view class="item">
- <view class="name">
- {{item.name}}
- </view>
- <view class="value" >
-
- <span>空闲{{item.idleNum}} / 共{{item.totalNum}}台</span>
- <!-- <span>{{item.contacts}}</span> -->
- <span>{{item.openStatusN}}</span>
- </view>
- </view>
- </view>
- <view class="goto">
- <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
- </view>
- </view>
-
-
-
- </view>
- </view>
- <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
-
- <tabbar :current="1"></tabbar>
- </view>
- </template>
- <script>
- import * as API from '@/apis/pagejs/deviceTab.js'
-
- import Tabbar from '@/components/Tabbar.vue'
- export default {
- components: {
- Tabbar
- },
- data() {
- return {
- title:"场站列表",
- list:[],
- listForm:{
- pageIndex: 1,
- pageSize: 20,
- recordsTotal: 1,
- },
- };
- },
- onLoad() {
- this.getList()
- },
- onReachBottom() {
- if (this.list.length < this.listForm.recordsTotal) {
- this.myLoadmore();
- }
- },
- methods: {
-
- myLoadmore(){
- this.listForm.pageIndex += 1;
- this.getList()
- },
- getList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API.parkingList(this.listForm).then((res) => {
-
- var list=this.list
-
- if (this.listForm.pageIndex == 1) {
- list = res.data.parkingInfoList;
- } else {
- list = [
- ...list,
- ...res.data.parkingInfoList
- ];
- }
- this.list=list
- uni.hideLoading();
-
- }).catch(error => {
-
- uni.hideLoading();
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
-
- }
- }
- </script>
- <style scoped lang="scss">
- .main{
- background-color: #fff;
- .line{
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 32rpx;
- border-bottom: 1px solid rgba(245,245,245,1);
-
- .body{
- display: flex;
- align-items: center;
-
- .imgclass{
- display: flex;
- align-items: center;
- justify-content: center;
- width: 72rpx;
- height: 72rpx;
- border-radius: 4px;
- background-color: rgba(219,234,255,1);
- }
- .item{
- margin-left: 16rpx;
-
- .name{
- color: rgba(51,51,51,1);
- font-size: 28rpx;
- }
- .value{
- color: rgba(119,119,119,1);
- font-size: 24rpx;
- span{
- margin-right: 16rpx;
- }
- }
- }
-
- }
- }
- .img{
- width: 48rpx;
- height: 48rpx;
- }
- }
- </style>
|