|
|
|
@ -79,6 +79,7 @@ |
|
|
|
备注:<text style="color: #000;">{{worker.remark || '无'}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-load-more :status="loadStatus" @change="onChange" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -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') { |
|
|
|
|