| | |
| | | // 处理解锁 |
| | | const getUnlockLocationPayload = async () => { |
| | | try { |
| | | const location = await Taro.getLocation({ type: 'gcj02' }); |
| | | Taro.showLoading({ title: '正在获取位置...', mask: true }); |
| | | const location = await Taro.getLocation({ type: 'gcj02', isHighAccuracy: true }); |
| | | Taro.hideLoading(); |
| | | const longitude = Number(location?.longitude); |
| | | const latitude = Number(location?.latitude); |
| | | if (!Number.isNaN(longitude) && !Number.isNaN(latitude)) { |
| | | return { longitude, latitude }; |
| | | } |
| | | } catch (_) { } |
| | | } catch (_) { |
| | | Taro.hideLoading(); |
| | | } |
| | | const startSite = Taro.getStorageSync('startSite') || {}; |
| | | const longitude = Number(startSite?.longitude); |
| | | const latitude = Number(startSite?.latitude); |