feat: 限制上门距离为500米

This commit is contained in:
gcd 2025-04-21 21:31:34 +08:00
parent e74dcf5ddb
commit 0cd425d055

View File

@ -197,7 +197,30 @@ const reportOrderException = (orderId) => {
//
const arrivedOnSite = () => {
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
//
uni.getLocation({
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)
}
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
},
fail(err) {
uni.showToast({
title: '请授权位置权限',
icon: "error"
})
}
});
}
//