|
@@ -1,32 +1,97 @@
|
|
|
<template>
|
|
|
- <view class="vinRecord">
|
|
|
+ <view class="vinRecord flex flex_column">
|
|
|
<view class="des">仅可查看最近7天的VIN查询记录</view>
|
|
|
- <view class="list-box">
|
|
|
- <view class="list-item flex align_center justify_between" v-for="item in 35">
|
|
|
- <view>
|
|
|
- <u-image shape="circle" src="@/static/share1.jpg" width='90' height="90"></u-image>
|
|
|
- </view>
|
|
|
- <view>
|
|
|
- <view class="flex align_center justify_between">
|
|
|
- <text class="vin-text">LFV2A21K0G4053021</text>
|
|
|
- <text class="time-text">2022-05-21 15:23:33</text>
|
|
|
+ <swiper class="list-box">
|
|
|
+ <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;">
|
|
|
+ <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
|
|
|
+ <view class="list-item flex align_center justify_between" v-for="item in list" :key="item.id">
|
|
|
+ <view>
|
|
|
+ <u-image shape="circle" :src="item.icon||'@/static/def_imgs.png'" width='90' height="90"></u-image>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view class="flex align_center justify_between">
|
|
|
+ <text class="vin-text">{{item.vinCode}}</text>
|
|
|
+ <text class="time-text">{{item.createDate}}</text>
|
|
|
+ </view>
|
|
|
+ <view>{{item.modelInfo}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view>马自达 CX-5(KE 2012-2017) 2.0L | 手自一体 2014款 都市型</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view style="padding: 20upx;">
|
|
|
+ <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
|
|
|
+ <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { getScanVinLogList }from '@/api/car.js'
|
|
|
+ import moment from 'moment'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ status: 'loading',
|
|
|
+ noDataText: '暂无数据',
|
|
|
+ // 查询条件
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
}
|
|
|
},
|
|
|
+ onLoad() {
|
|
|
+ this.pageInit()
|
|
|
+ },
|
|
|
methods: {
|
|
|
-
|
|
|
+ pageInit(){
|
|
|
+ this.total = 0
|
|
|
+ this.pageNo = 1
|
|
|
+ this.getRow()
|
|
|
+ },
|
|
|
+ // 查询列表
|
|
|
+ getRow (pageNo) {
|
|
|
+ let _this = this
|
|
|
+ if (pageNo) {
|
|
|
+ this.pageNo = pageNo
|
|
|
+ }
|
|
|
+ // 状态条件
|
|
|
+ const state = ['WAIT','FINISH','CLOSE']
|
|
|
+ let params = {
|
|
|
+ beginDate: moment().subtract('days', 6).format('YYYY-MM-DD 00:00:00'),
|
|
|
+ endDate: moment(moment().valueOf()).format('YYYY-MM-DD 23:59:59'),
|
|
|
+ pageNo: this.pageNo,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ billState: state[this.swiperCurrent]
|
|
|
+ }
|
|
|
+ this.status = "loading"
|
|
|
+ getScanVinLogList(params).then(res => {
|
|
|
+ if (res.code == 200 || res.status == 204 || res.status == 200) {
|
|
|
+ const retList = res.data.list.filter(item => item.vinCode)
|
|
|
+ if(_this.pageNo>1){
|
|
|
+ _this.list = _this.list.concat(retList || [])
|
|
|
+ }else{
|
|
|
+ _this.list = retList || []
|
|
|
+ }
|
|
|
+ _this.total = res.data.count || 0
|
|
|
+ } else {
|
|
|
+ _this.list = []
|
|
|
+ _this.total = 0
|
|
|
+ _this.noDataText = res.message
|
|
|
+ }
|
|
|
+ _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // scroll-view到底部加载更多
|
|
|
+ onreachBottom() {
|
|
|
+ if(this.list.length < this.total){
|
|
|
+ this.pageNo += 1
|
|
|
+ this.getRow()
|
|
|
+ }else{
|
|
|
+ this.status = "nomore"
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -34,6 +99,7 @@
|
|
|
<style lang="less">
|
|
|
.vinRecord{
|
|
|
width: 100%;
|
|
|
+ height: 100vh;
|
|
|
background: #f8f8f8;
|
|
|
.des{
|
|
|
text-align: center;
|
|
@@ -41,6 +107,10 @@
|
|
|
font-size: 12px;
|
|
|
padding: 20rpx 15rpx;
|
|
|
}
|
|
|
+ .list-box{
|
|
|
+ flex-grow: 1;
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
.list-item{
|
|
|
margin: 20rpx 30rpx;
|
|
|
border:2rpx solid #f8f8f8;
|
|
@@ -51,6 +121,7 @@
|
|
|
> view{
|
|
|
padding: 0 10rpx;
|
|
|
&:last-child{
|
|
|
+ flex-grow: 1;
|
|
|
>view{
|
|
|
padding: 10rpx 0;
|
|
|
}
|