|
@@ -29,7 +29,7 @@
|
|
|
return {
|
|
|
keyword: '',
|
|
|
pageIndex: 1,
|
|
|
- pageSize: 100,
|
|
|
+ recordsTotal: 0,
|
|
|
orgResult: [],
|
|
|
actionStyle: {
|
|
|
background: '#FF5E5E',
|
|
@@ -40,6 +40,14 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.getList(true);
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.likeList.length < this.recordsTotal) {
|
|
|
+ this.myLoadmore();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
getRegister(item) {
|
|
|
this.carhelp.set("searchOrgItem",item)
|
|
@@ -47,19 +55,25 @@
|
|
|
url: '/pagesA/pages/login/register'
|
|
|
})
|
|
|
},
|
|
|
- getList() {
|
|
|
+ getList(bl) {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
})
|
|
|
+ if(bl) {
|
|
|
+ this.orgResult = [];
|
|
|
+ this.pageIndex = 1;
|
|
|
+ }
|
|
|
loginApi.orgList({
|
|
|
pageIndex: this.pageIndex,
|
|
|
- pageSize: this.pageSize,
|
|
|
+ pageSize: 10,
|
|
|
orgName: this.keyword
|
|
|
- }).then((response) => {
|
|
|
- var jsonData = response.data.data;
|
|
|
- console.log(jsonData);
|
|
|
- this.orgResult = jsonData;
|
|
|
+ }).then((res) => {
|
|
|
+ this.orgResult = [
|
|
|
+ ...this.orgResult,
|
|
|
+ ...res.data.data
|
|
|
+ ];
|
|
|
+ this.recordsTotal = res.data.recordsTotal
|
|
|
uni.hideLoading()
|
|
|
})
|
|
|
.catch((error) => {
|
|
@@ -68,28 +82,13 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- searchQrg() {
|
|
|
- uni.showLoading({
|
|
|
- title: "加载中",
|
|
|
- mask: true,
|
|
|
- })
|
|
|
- loginApi.orgList({
|
|
|
- pageIndex: this.pageIndex,
|
|
|
- pageSize: this.pageSize,
|
|
|
- orgName: this.keyword
|
|
|
- }).then((response) => {
|
|
|
- var jsonData = response.data.data;
|
|
|
- this.orgResult = jsonData;
|
|
|
- uni.hideLoading();
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- uni.showToast({
|
|
|
- title: error,icon: "none"
|
|
|
- })
|
|
|
- })
|
|
|
+ myLoadmore() {
|
|
|
+ this.pageIndex += 1;
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- onReady() {
|
|
|
- this.getList();
|
|
|
+ searchQrg() {
|
|
|
+ console.log(this.keyword);
|
|
|
+ this.getList(true);
|
|
|
}
|
|
|
}
|
|
|
}
|