增加获取场馆、字典

This commit is contained in:
筱野
2025-08-24 16:04:31 +08:00
parent c6f4f11259
commit bb6ec8c183
29 changed files with 1217 additions and 414 deletions

View File

@@ -1,5 +1,12 @@
import Taro from '@tarojs/taro'
export interface Location {
latitude: number
longitude: number
speed?: number
accuracy?: number
}
export interface LocationInfo {
latitude: number
longitude: number
@@ -56,6 +63,24 @@ export const chooseLocation = (): Promise<LocationInfo> => {
})
}
export const getLocation = (): Promise<Location> => {
return new Promise((resolve, reject) => {
Taro.getLocation({
success: (res) => {
resolve({
latitude: res.latitude,
longitude: res.longitude,
speed: res.speed,
accuracy: res.accuracy
})
},
fail: (error) => {
reject(error)
}
})
})
}
// 逆地理编码简化版本实际项目中应该调用真实的地图服务API
export const reverseGeocode = (latitude: number, longitude: number): Promise<string> => {
return new Promise((resolve) => {