feat: 提示优化
This commit is contained in:
parent
eb1b1d3e09
commit
0050d4989a
|
|
@ -195,7 +195,14 @@ const arrivedOnSite = () => {
|
||||||
|
|
||||||
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);
|
||||||
if (envVersion === 'release' && (distances.unit === '公里' || distances.distance > 500)) {
|
if (envVersion === 'release' && (distances.unit === '公里' || distances.distance > 500)) {
|
||||||
return helpers.showToast(`上门失败!距离客户地址超过 500 米,当前距离:${distances.distance}${distances.unit}`)
|
uni.showModal({
|
||||||
|
title: '上门失败',
|
||||||
|
showCancel: false,
|
||||||
|
content: `距离客户地址超过 500 米,当前距离:${distances.distance}${distances.unit}`,
|
||||||
|
success: function (res) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
|
helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,13 @@ class helpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
static showToast(msg) {
|
static showToast(msg) {
|
||||||
let duration = 1500
|
let duration = 2000
|
||||||
if (msg.length > 7) {
|
if (msg.length > 7) {
|
||||||
duration = 2000
|
duration = 3000
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.length > 14) {
|
if (msg.length > 14) {
|
||||||
duration = 4000
|
duration = 5000
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user