diff --git a/package1/group/groupBuyList.vue b/package1/group/groupBuyList.vue index 4c4e2ce..17f3fdc 100644 --- a/package1/group/groupBuyList.vue +++ b/package1/group/groupBuyList.vue @@ -281,6 +281,7 @@ }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() + this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id // uni.showLoading({ // title: '加载中...', // mask: true diff --git a/package1/index/deliveryPersonList.vue b/package1/index/deliveryPersonList.vue index 9a9a6e5..bd42d23 100644 --- a/package1/index/deliveryPersonList.vue +++ b/package1/index/deliveryPersonList.vue @@ -79,6 +79,7 @@ 备注:{{worker.remark || '无'}} + @@ -86,6 +87,7 @@ export default { data() { return { + loadStatus: 'more', isArea: false, latitude: 39.909, // 默认纬度,可以设为用户当前位置或配送员位置 longitude: 116.39742, // 默认经度 @@ -103,14 +105,28 @@ },{ id: 2, title: '配送费低' + },{ + id: 3, + title: '清空' }], shopAreaId: '', + regionId:JSON.parse(uni.getStorageSync('area')).id, + sortField:"score", putAreaId: '', workerList: [], orderType:null, + pageNum: 1, // ← 新增 + pageSize: 10, + totalPages: 1, keyword: '' } }, + onReachBottom() { + if (this.pageNum >= this.totalPages) return; + // this.status = 'loading'; + this.pageNum++; + this.getShopList(); + }, onLoad(option) { this.shopAreaId = option.shopAreaId || ''; this.putAreaId = option.putAreaId || ''; @@ -119,9 +135,11 @@ }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() + this.regionId = JSON.parse(uni.getStorageSync('area')).id }, methods: { getShopList() { + this.loadStatus = 'loading'; // Fake request to our new endpoint let payload = { shopAreaId: this.shopAreaId, @@ -129,11 +147,25 @@ putAreaId: this.putAreaId, baozhang: this.baozhang, xiangtong: this.xiangtong, - keyword: this.keyword + sortField:this.sortField, + regionId:this.regionId, + keyword: this.keyword, + pageNum: this.pageNum, + pageSize: this.pageSize }; + let that = this this.tui.request("/worker/getMatchingWorkerList", "POST", payload, false, false).then(res => { + that.loadStatus = 'nomore'; if(res.code == 200) { - this.workerList = res.result || []; + if(res.result != null){ + if (that.pageNum == 1) { + that.workerList = res.result.records || []; + } else { + that.workerList = [...that.workerList, ...res.result.records]; + } + that.totalPages = res.result.pages; // pages = 总页数 + that.$forceUpdate(); + } } }); }, @@ -144,7 +176,15 @@ }, searchShop(type, value) { if (type == 'area') { - // this.searchForm.shopArea = value + if(value == 0){ + this.sortField = 'avgTime' + }else if(value == 1){ + this.sortField = 'score' + }else if(value == 2){ + this.sortField = 'orderBkge' + }else{ + this.sortField = 'score' + } } else if (type == 'baozhang') { this.baozhang = !this.baozhang } else if (type == 'xiangtong') {