feat: 限制上门距离为500米

This commit is contained in:
gcd 2025-04-21 21:32:41 +08:00
parent 0cd425d055
commit e6ff122ee9

View File

@ -202,14 +202,8 @@ const arrivedOnSite = () => {
type: 'gcj02',
success(res) {
let distances = helpers.getDistances(res.latitude, res.longitude, data.value.order_info.lat, data.value.order_info.lng);
let msg = `上门失败!距离客户地址超过 500米当前距离${distances.distance}${distances.unit}`
if (distances.unit === '公里') {
return helpers.showToast(msg)
}
if (distances.distance > 500) {
return helpers.showToast(msg)
if (distances.unit === '公里' || distances.distance > 500) {
return helpers.showToast(`上门失败!距离客户地址超过 500米当前距离${distances.distance}${distances.unit}`)
}
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)