feat: 限制上门距离为500米
This commit is contained in:
parent
0cd425d055
commit
e6ff122ee9
|
|
@ -202,14 +202,8 @@ const arrivedOnSite = () => {
|
||||||
type: 'gcj02',
|
type: 'gcj02',
|
||||||
success(res) {
|
success(res) {
|
||||||
let distances = helpers.getDistances(res.latitude, res.longitude, data.value.order_info.lat, data.value.order_info.lng);
|
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 === '公里' || distances.distance > 500) {
|
||||||
|
return helpers.showToast(`上门失败!距离客户地址超过 500米,当前距离:${distances.distance}${distances.unit}`)
|
||||||
if (distances.unit === '公里') {
|
|
||||||
return helpers.showToast(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (distances.distance > 500) {
|
|
||||||
return helpers.showToast(msg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
|
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user