You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
3.1 KiB
122 lines
3.1 KiB
<template> |
|
<view class="page-content "> |
|
<cu-custom class="main- totextbar bg-main-oil" round :isBack="true" bgColor="bg-main-oil"> |
|
<block slot="backText">返回</block> |
|
<block slot="content">公户加油</block> |
|
</cu-custom> |
|
<view class="cu-bar padding-bottom padding-top solids-bottom search"> |
|
<view class="search-form round"> |
|
<text class="cuIcon-search"></text> |
|
<input class="" v-model="searchCondition" @confirm="onSearch" @focus="InputFocus" @blur="InputBlur" |
|
:adjust-position="false" type="text" clearable placeholder="请输入车牌号搜索" confirm-type="search"></input> |
|
</view> |
|
</view> |
|
<view class="cu-list menu sm-border" v-if="userList.length>0"> |
|
<driver-item class="cu-item" v-for="item in userList" :key="item.driverId" :driver="item" /> |
|
</view> |
|
<view v-if="userList.length<1"> |
|
<Empty /> |
|
</view> |
|
<view v-show="isLoadMore"> |
|
<uni-load-more :status="loadStatus"></uni-load-more> |
|
</view> |
|
</view> |
|
</template> |
|
|
|
<script> |
|
import UniLoadMore from '@/components/uni-load-more/uni-load-more.vue' |
|
import partnerApi from '@/api/partner.js' |
|
import DriverItem from '../../../components/driver-item.vue' |
|
export default { |
|
components: { |
|
DriverItem, |
|
UniLoadMore |
|
}, |
|
data() { |
|
return { |
|
searchCondition: '', |
|
staff: { |
|
data: 'lalall' |
|
}, |
|
pageSize: 10, |
|
currentPage: 1, |
|
oilSite: uni.getStorageSync('oilSite'), |
|
userList: [], |
|
value: '', |
|
isLoadMore: false, |
|
loadStatus: 'loading', |
|
companyId: '' |
|
} |
|
}, |
|
onLoad(option) { |
|
console.log(option.id) |
|
this.companyId = option.id |
|
}, |
|
onShow() { |
|
this.userList = [] |
|
this.currentPage = 1 |
|
this.getList() |
|
}, |
|
onPullDownRefresh() { |
|
this.userList = [] |
|
this.currentPage = 1 |
|
this.getList() |
|
}, |
|
onReachBottom() { |
|
if (!this.isLoadMore) { |
|
console.log('xiala') |
|
this.getList() |
|
} |
|
}, |
|
methods: { |
|
InputBlur() { |
|
// this.isLoadMore = false |
|
// console.log(this.searchCondition) |
|
// this.userList = [] |
|
// this.currentPage = 1 |
|
// this.getList() |
|
// console.log('InputBlur') |
|
}, |
|
InputFocus() { |
|
console.log(this.searchCondition) |
|
}, |
|
onSearch() { |
|
this.isLoadMore = false |
|
this.userList = [] |
|
this.currentPage = 1 |
|
console.log('onSearch') |
|
this.getList() |
|
}, |
|
getList() { |
|
if (!this.isLoadMore) { |
|
const data3 = { |
|
pageSize: this.pageSize, |
|
currentPage: this.currentPage, |
|
plateNumber: this.searchCondition, |
|
belongCompany: this.companyId |
|
} |
|
partnerApi.getUserMegByCarNo(data3).then(res => { |
|
uni.stopPullDownRefresh(); |
|
if (res.code == 20000) { |
|
this.userList = this.userList.concat(res.data) |
|
if (res.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页 |
|
this.isLoadMore = true |
|
this.loadStatus = 'nomore' |
|
} else { |
|
this.currentPage++ |
|
this.isLoadMore = false |
|
} |
|
console.log(this.isLoadMore, this.loadStatus, this.currentPage) |
|
} |
|
}) |
|
} |
|
} |
|
} |
|
} |
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
.page-content { |
|
min-height: 100%; |
|
} |
|
</style>
|
|
|