fix: bug修复

This commit is contained in:
Mrxtyyp 2024-05-27 21:38:44 +08:00
parent 11b277d295
commit a2a4370327
2 changed files with 14 additions and 16 deletions

View File

@ -548,9 +548,9 @@ export default {
}) })
return res[1].data; return res[1].data;
}, },
async getWorkerList(params = {}) { async getWorkerList(params = {}, pageNum, pageSize) {
let res = await uni.request({ let res = await uni.request({
url: '/worker/app/list', url: `/worker/app/list?pageNum=${pageNum}&pageSize=${pageSize}`,
method: 'POST', method: 'POST',
data: params data: params
}) })

View File

@ -213,9 +213,9 @@
otherCityWorkers: [], otherCityWorkers: [],
loadMoreStatus: '', loadMoreStatus: '',
hasMoreData: false, hasMoreData: false,
pageNum: 0, pageNum: 1,
otherCityWorkersPageNum: 0, otherCityWorkersPageNum: 1,
pageSize: 0, pageSize: 10,
stickyTop: this.CustomBar, stickyTop: this.CustomBar,
searchInfo: {}, searchInfo: {},
curPositionDistrictId: -1, curPositionDistrictId: -1,
@ -232,8 +232,8 @@
}, },
methods: { methods: {
async loadData() { async loadData() {
this.pageNum = this.$globalData.initPageNum; // this.pageNum = this.$globalData.initPageNum;
this.pageSize = this.$globalData.initPageSize; // this.pageSize = this.$globalData.initPageSize;
// //
await this.getCurAreaArr(); await this.getCurAreaArr();
await this.loadRegionList(); await this.loadRegionList();
@ -285,11 +285,10 @@
} }
this.workerInfos = this.workerInfos.concat(res.rows); this.workerInfos = this.workerInfos.concat(res.rows);
this.pageNum++; this.pageNum++;
if (rowsLength === this.pageSize) { this.$refs.loadStatusBar1.showLoadMore();
this.$refs.loadStatusBar1.showLoadMore(); } else {
} this.$refs.loadStatusBar1.showLoadOver();
} }
this.$refs.loadStatusBar1.showLoadOver();
} catch (e) { } catch (e) {
console.error(e) console.error(e)
this.$refs.loadStatusBar1.showLoadErr(); this.$refs.loadStatusBar1.showLoadErr();
@ -301,16 +300,15 @@
params.exceptParentAreaId = this.searchInfo.area && this.searchInfo.area.length ? this.searchInfo.area[1].areaId : null; params.exceptParentAreaId = this.searchInfo.area && this.searchInfo.area.length ? this.searchInfo.area[1].areaId : null;
this.$refs.loadStatusBar2.showLoading(); this.$refs.loadStatusBar2.showLoading();
try { try {
let res = await this.$request.getWorkerList(params); let res = await this.$request.getWorkerList(params, params.pageNum, params.pageSize);
let rowsLength = res.rows.length; let rowsLength = res.rows.length;
if (rowsLength > 0) { if (rowsLength > 0) {
this.otherCityWorkers = this.otherCityWorkers.concat(res.rows); this.otherCityWorkers = this.otherCityWorkers.concat(res.rows);
this.otherCityWorkersPageNum++; this.otherCityWorkersPageNum++;
if (rowsLength === this.pageSize) { this.$refs.loadStatusBar2.showLoadMore();
this.$refs.loadStatusBar2.showLoadMore(); } else {
} this.$refs.loadStatusBar2.showLoadOver();
} }
this.$refs.loadStatusBar2.showLoadOver();
} catch (e) { } catch (e) {
console.error(e) console.error(e)
this.$refs.loadStatusBar2.showLoadErr(); this.$refs.loadStatusBar2.showLoadErr();