From c4246ca910f28014efaace64ebf92f47a673a9cf Mon Sep 17 00:00:00 2001 From: queenwuli <942534046@qq.com> Date: Mon, 25 Jan 2021 11:47:46 +0800 Subject: [PATCH] gx --- hive-app/pages/workbench/selectCustomer.vue | 61 ++++++++++++++++++++++-------- 1 files changed, 44 insertions(+), 17 deletions(-) diff --git a/hive-app/pages/workbench/selectCustomer.vue b/hive-app/pages/workbench/selectCustomer.vue index 5a2e8ef..73d3b0d 100644 --- a/hive-app/pages/workbench/selectCustomer.vue +++ b/hive-app/pages/workbench/selectCustomer.vue @@ -2,7 +2,7 @@ <view class="container"> <search-bar @confirm="search"></search-bar> <view class="flex justify-between"> - <view class="flex-1 mr-10"> + <view class="flex-1"> <navigator class="member-list flex align-center" :url="'./customerInfo?type='+type+'&id='+item.id" hover-class="none" @@ -26,8 +26,11 @@ </view> </navigator> <no-record :isShow="!list.length"></no-record> + <view v-if="list.length"> + <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more> + </view> </view> - <indexed-list></indexed-list> + <!-- <indexed-list></indexed-list> --> </view> </view> </template> @@ -35,17 +38,21 @@ <script> import searchBar from '../../components/searchBar/index.vue'; import indexedList from '../../components/indexedList/index.vue'; + import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'; export default { components:{ searchBar, - indexedList + indexedList, + uniLoadMore }, data() { return { type: 1 ,//1新建订单 2新建服务单 colors: ['#CCC6B4', '#C0CCB4', '#B4C2CC', '#BEB4CC', '#B4CCBE', '#B4CCCA', '#CCB4C6', '#CCB4B4'], queryKey: '', - list: [] + list: [], + loadStatus: 'more', + pageNum: 1 }; }, onLoad(options) { @@ -54,33 +61,53 @@ } this.loadMemberList() }, + onPullDownRefresh(){ + this.reloadData(); + let timer = setTimeout(function () { + uni.stopPullDownRefresh(); + clearTimeout(timer); + timer = null; + }, 800); + }, + onReachBottom(){ + this.loadMemberList() + }, methods:{ + reloadData(){ + this.list = []; + this.pageNum = 1; + this.loadStatus = 'more'; + this.loadMemberList(); + }, caculateBgcolor(index){ return this.colors[index%8]; }, search(val){ this.queryKey = val; - this.loadMemberList(); + this.reloadData(); }, loadMemberList(){ - uni.showLoading({ - mask: true, - title: '加载中' - }); + if(this.loadStatus!=='more'){ + return; + } let parma = Object.assign({ order: this.order, queryKey: this.queryKey, - sort: this.sort - }, this.filterKeys) + sort: this.sort, + pageNum: this.pageNum, + pageSize: 15 + }) this.$httpUtils.request('/api/vip/findVipInfoList', parma, 'POST').then((res) => { if(res.status == 200){ - this.list = res.rows; + let result = res.rows; + if(result.length < 15){ + this.loadStatus = 'noMore'; + } else { + this.pageNum ++ ; + this.loadStatus = 'more'; + } + this.list = this.list.concat(result); } - this.$nextTick(function(){ - uni.hideLoading() - }) - }).catch((err) => { - uni.hideLoading() }) } }, -- Gitblit v1.9.1