|
|
@ -34,9 +34,9 @@ const instance = defineStore('user', { |
|
|
|
let geolocation = new AMap.Geolocation({ |
|
|
|
let geolocation = new AMap.Geolocation({ |
|
|
|
// enableHighAccuracy: true // 是否使用高精度定位,默认:true
|
|
|
|
// enableHighAccuracy: true // 是否使用高精度定位,默认:true
|
|
|
|
}) |
|
|
|
}) |
|
|
|
geolocation.getCurrentPosition(function (status, result) { |
|
|
|
geolocation.getCurrentPosition((status, result) => { |
|
|
|
console.log('piniaIndex status', status) |
|
|
|
// console.log('piniaIndex status', status)
|
|
|
|
console.log('piniaIndex result', result) |
|
|
|
// console.log('piniaIndex result', result)
|
|
|
|
if (status === 'complete') { |
|
|
|
if (status === 'complete') { |
|
|
|
let { lat: latitude, lng: longitude } = result.position |
|
|
|
let { lat: latitude, lng: longitude } = result.position |
|
|
|
this.position = { latitude, longitude } |
|
|
|
this.position = { latitude, longitude } |
|
|
|