From a6653e19d20a61e7b8f788037d2a4df3f93a4f32 Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Tue, 12 Jan 2021 16:51:03 +0800
Subject: [PATCH] gx
---
hive-app/pages/member/skinDetection.vue | 44 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/hive-app/pages/member/skinDetection.vue b/hive-app/pages/member/skinDetection.vue
index 5524612..6efdddd 100644
--- a/hive-app/pages/member/skinDetection.vue
+++ b/hive-app/pages/member/skinDetection.vue
@@ -19,30 +19,66 @@
</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: []
+ list: [],
+ loadStatus: 'more',
+ pageNum: 1
}
},
onLoad(options) {
this.id = options.id;
this.loadList()
},
+ onPullDownRefresh(){
+ this.reloadData();
+ let timer = setTimeout(function () {
+ uni.startPullDownRefresh();
+ 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: 1,
- pageSize: 100,
+ pageNum: this.pageNum,
+ pageSize: 10,
vipId: this.id
}, 'POST').then((res) => {
if(res.status == 200){
- this.list = res.rows;
+ let result = res.rows;
+ if(result.length < 10){
+ this.loadStatus = 'noMore';
+ } else {
+ this.pageNum ++ ;
+ this.loadStatus = 'more';
+ }
+ this.list = this.list.concat(result);
}
})
}
--
Gitblit v1.9.1