<template>
|
<view class="container">
|
<view class="list-item" v-for="item in list">
|
<navigator :url="'./skinDetectionDetail?id='+item.id+'&title='+(item.title?item.title:'')" hover-class="" >
|
<view class="list-header">
|
<text class="name">{{item.title || '-'}}</text>
|
<text class="gray">{{item.checkTime}}</text>
|
</view>
|
<view class="list-content">
|
<view class="flex justify-between">
|
<text>检测师</text>
|
<text class="gray">{{item.checkUserName}}</text>
|
</view>
|
<view class="flex justify-between">
|
<text>检测门店</text>
|
<text class="gray">{{item.shopName}}</text>
|
</view>
|
</view>
|
</navigator>
|
</view>
|
<no-record :isShow="!list.length" txt="暂无检测报告"></no-record>
|
<view v-if="list.length">
|
<uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
export default{
|
components: {
|
uniLoadMore
|
},
|
data(){
|
return {
|
id: '',
|
list: [],
|
loadStatus: 'more',
|
pageNum: 1
|
}
|
},
|
onLoad(options) {
|
this.id = options.id;
|
this.loadList()
|
},
|
onPullDownRefresh(){
|
this.reloadData();
|
let timer = setTimeout(function () {
|
uni.stopPullDownRefresh();
|
clearTimeout(timer);
|
timer = null;
|
}, 800);
|
},
|
onReachBottom(){
|
this.loadList()
|
},
|
methods:{
|
reloadData(){
|
this.list = [];
|
this.pageNum = 1;
|
this.loadStatus = 'more';
|
this.loadList();
|
},
|
loadList(){
|
if(this.loadStatus!=='more'){
|
return;
|
}
|
this.$httpUtils.request('/api/skinCheck/findSkinCheckList', {
|
pageNum: this.pageNum,
|
pageSize: 10,
|
vipId: this.id
|
}, 'POST').then((res) => {
|
if(res.status == 200){
|
let result = res.rows;
|
if(result.length < 10){
|
this.loadStatus = 'noMore';
|
} else {
|
this.pageNum ++ ;
|
this.loadStatus = 'more';
|
}
|
this.list = this.list.concat(result);
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
page{
|
background: #F6F6F8;
|
}
|
.container{
|
padding: 15px 10px;
|
}
|
.list-item{
|
background: #FFFFFF;
|
color: #3a3f3f;
|
font-size: 14px;
|
padding: 12px 15px;
|
border-radius: 4px;
|
margin-bottom: 10px;
|
}
|
.list-header{
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.list-header .name{
|
font-size: 15px;
|
font-weight: bold;
|
}
|
.list-content{
|
padding-top: 10px;
|
line-height: 26px;
|
}
|
</style>
|