罗广辉
2026-04-24 648904d076ae6e17892b40675598b1c8dc474277
src/hooks/use-location/index.js
@@ -5,7 +5,7 @@
 * - 地址解析
 * - 距离计算
 */
export default function useLocation() {
export default function useLocation () {
  // 当前位置信息
  const location = ref(null)
@@ -191,9 +191,9 @@
    const a =
      Math.sin(dLat / 2) * Math.sin(dLat / 2) +
      Math.cos((lat1 * Math.PI) / 180) *
        Math.cos((lat2 * Math.PI) / 180) *
        Math.sin(dLon / 2) *
        Math.sin(dLon / 2)
      Math.cos((lat2 * Math.PI) / 180) *
      Math.sin(dLon / 2) *
      Math.sin(dLon / 2)
    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
    const distance = R * c