|
@@ -928,7 +928,7 @@ export default {
|
|
|
const [latStr, lngStr] = this.cancelForm.cancelLocation.split(',');
|
|
const [latStr, lngStr] = this.cancelForm.cancelLocation.split(',');
|
|
|
const latitude = parseFloat(latStr);
|
|
const latitude = parseFloat(latStr);
|
|
|
const longitude = parseFloat(lngStr);
|
|
const longitude = parseFloat(lngStr);
|
|
|
-
|
|
|
|
|
|
|
+ let formattedAddress = '';
|
|
|
// 调用后台API进行逆地理编码
|
|
// 调用后台API进行逆地理编码
|
|
|
try {
|
|
try {
|
|
|
const geocodingResponse = await request({
|
|
const geocodingResponse = await request({
|
|
@@ -941,7 +941,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (geocodingResponse.code === 200 && geocodingResponse.data) {
|
|
if (geocodingResponse.code === 200 && geocodingResponse.data) {
|
|
|
- const formattedAddress = geocodingResponse.data.regeocode?.formattedAddress;
|
|
|
|
|
|
|
+ formattedAddress = geocodingResponse.data.regeocode?.formattedAddress;
|
|
|
if (formattedAddress) {
|
|
if (formattedAddress) {
|
|
|
console.log('销假位置逆地理编码成功:', formattedAddress);
|
|
console.log('销假位置逆地理编码成功:', formattedAddress);
|
|
|
// 可以选择将地址信息显示给用户或保存到表单中
|
|
// 可以选择将地址信息显示给用户或保存到表单中
|
|
@@ -960,7 +960,8 @@ export default {
|
|
|
await this.wechatSDK.openLocation({
|
|
await this.wechatSDK.openLocation({
|
|
|
latitude,
|
|
latitude,
|
|
|
longitude,
|
|
longitude,
|
|
|
- name: formattedAddress,
|
|
|
|
|
|
|
+ name: formattedAddress || '请假位置',
|
|
|
|
|
+ address: formattedAddress || '当前位置',
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -980,7 +981,7 @@ export default {
|
|
|
const latitude = parseFloat(latStr);
|
|
const latitude = parseFloat(latStr);
|
|
|
const longitude = parseFloat(lngStr);
|
|
const longitude = parseFloat(lngStr);
|
|
|
if (Number.isNaN(latitude) || Number.isNaN(longitude)) return;
|
|
if (Number.isNaN(latitude) || Number.isNaN(longitude)) return;
|
|
|
-
|
|
|
|
|
|
|
+ let formattedAddress = '';
|
|
|
// 调用后台API进行逆地理编码
|
|
// 调用后台API进行逆地理编码
|
|
|
try {
|
|
try {
|
|
|
const geocodingResponse = await request({
|
|
const geocodingResponse = await request({
|
|
@@ -993,7 +994,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (geocodingResponse.code === 200 && geocodingResponse.data) {
|
|
if (geocodingResponse.code === 200 && geocodingResponse.data) {
|
|
|
- const formattedAddress = geocodingResponse.data.regeocode?.formattedAddress;
|
|
|
|
|
|
|
+ formattedAddress = geocodingResponse.data.regeocode?.formattedAddress;
|
|
|
if (formattedAddress) {
|
|
if (formattedAddress) {
|
|
|
console.log('请假位置逆地理编码成功:', formattedAddress);
|
|
console.log('请假位置逆地理编码成功:', formattedAddress);
|
|
|
// 可以选择将地址信息显示给用户或保存到表单中
|
|
// 可以选择将地址信息显示给用户或保存到表单中
|
|
@@ -1012,7 +1013,8 @@ export default {
|
|
|
await this.wechatSDK.openLocation({
|
|
await this.wechatSDK.openLocation({
|
|
|
latitude,
|
|
latitude,
|
|
|
longitude,
|
|
longitude,
|
|
|
- name: formattedAddress,
|
|
|
|
|
|
|
+ name: formattedAddress || '请假位置',
|
|
|
|
|
+ address: formattedAddress || '当前位置',
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|