新增分页加载功能,提高相应速度
This commit is contained in:
parent
0043effd95
commit
fd1ea22e6d
@ -69,10 +69,12 @@
|
||||
return {
|
||||
show: false,
|
||||
loadConfig:{
|
||||
page: 1,
|
||||
limit: 15,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
status: 'nomore'
|
||||
status: 'loadmore'
|
||||
},
|
||||
areaManagerList:[]
|
||||
}
|
||||
@ -87,10 +89,24 @@
|
||||
onShow() {
|
||||
this.loadAreaManager();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadAreaManager();
|
||||
},
|
||||
methods: {
|
||||
async loadAreaManager(){
|
||||
let res = await companyAreaManager();
|
||||
this.areaManagerList = res.data;
|
||||
if(this.loadConfig.status=="nomore")return;
|
||||
this.loadConfig.status="loading"
|
||||
let res = await companyAreaManager({
|
||||
page: this.loadConfig.page,
|
||||
limit: this.loadConfig.limit
|
||||
})
|
||||
this.loadConfig.status="loadmore"
|
||||
if(res.data.data.length<this.loadConfig.limit){
|
||||
this.loadConfig.status="nomore"
|
||||
}else {
|
||||
this.loadConfig.page++;
|
||||
}
|
||||
this.areaManagerList = [...this.areaManagerList, ...res.data?.data]
|
||||
},
|
||||
//拨打电话
|
||||
callUp(phone) {
|
||||
|
@ -69,10 +69,12 @@
|
||||
return {
|
||||
show: false,
|
||||
loadConfig:{
|
||||
page: 1,
|
||||
limit: 15,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
status: 'nomore'
|
||||
status: 'loadmore'
|
||||
},
|
||||
areaManagerList:[]
|
||||
}
|
||||
@ -87,10 +89,24 @@
|
||||
onShow() {
|
||||
this.loadAreaManager();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadAreaManager();
|
||||
},
|
||||
methods: {
|
||||
async loadAreaManager(){
|
||||
let res = await companyAreaManager();
|
||||
this.areaManagerList = res.data;
|
||||
if(this.loadConfig.status=="nomore")return;
|
||||
this.loadConfig.status="loading"
|
||||
let res = await companyAreaManager({
|
||||
page: this.loadConfig.page,
|
||||
limit: this.loadConfig.limit
|
||||
})
|
||||
this.loadConfig.status="loadmore"
|
||||
if(res.data.data.length<this.loadConfig.limit){
|
||||
this.loadConfig.status="nomore"
|
||||
}else {
|
||||
this.loadConfig.page++;
|
||||
}
|
||||
this.areaManagerList = [...this.areaManagerList, ...res.data?.data]
|
||||
},
|
||||
//拨打电话
|
||||
callUp(phone) {
|
||||
|
@ -47,6 +47,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
<!-- <view class="personnel_item">
|
||||
<view class="type type_blue">
|
||||
<image src="../../static/icons/ok_w.png"></image>
|
||||
@ -102,6 +103,14 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadConfig:{
|
||||
page: 1,
|
||||
limit: 15,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
status: 'loadmore'
|
||||
},
|
||||
userList: []
|
||||
}
|
||||
},
|
||||
@ -116,14 +125,21 @@ export default {
|
||||
url: url,
|
||||
}) : Toast('暂未开放')
|
||||
},
|
||||
loadUserList(){
|
||||
async loadUserList(){
|
||||
let that = this;
|
||||
companyUser({
|
||||
page: 1,
|
||||
limit: 15
|
||||
}).then(res=>{
|
||||
that.userList = res.data.data;
|
||||
if(this.loadConfig.status=="nomore")return;
|
||||
this.loadConfig.status="loading"
|
||||
let res = await companyUser({
|
||||
page: this.loadConfig.page,
|
||||
limit: this.loadConfig.limit
|
||||
})
|
||||
this.loadConfig.status="loadmore"
|
||||
if(res.data.data.length<this.loadConfig.limit){
|
||||
this.loadConfig.status="nomore"
|
||||
}else {
|
||||
this.loadConfig.page++;
|
||||
}
|
||||
this.userList = [...this.userList, ...res.data?.data]
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user