This commit is contained in:
2026-07-30 15:11:46 +08:00
parent be76eaf2b1
commit 190b5fe527
3 changed files with 20 additions and 39 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pointly-Tel - 高德POI商户查询</title>
<script type="module" crossorigin src="/assets/index-CB8CRFzz.js"></script>
<script type="module" crossorigin src="/assets/index-Bb-YnKrp.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-C3fajWoH.css">
</head>
<body>
+19
View File
@@ -341,6 +341,15 @@ function onSuggestArrow(dir) {
function selectSuggestion(item) {
keywords.value = item.name
hideSuggestions()
// 联想位置有坐标则设为搜索中心点
if (item.longitude && item.latitude) {
const lat = parseFloat(item.latitude)
const lng = parseFloat(item.longitude)
if (!isNaN(lat) && !isNaN(lng)) {
centerLat.value = lat
centerLng.value = lng
}
}
doSearch()
}
@@ -356,6 +365,16 @@ async function doSearch() {
return
}
// 搜索前跳转地图到目标区域
if (mapRef.value) {
if (hasCoord) {
mapRef.value.flyTo(centerLat.value, centerLng.value, 14)
} else if (city.value && cityCoords[city.value]) {
const coord = cityCoords[city.value]
mapRef.value.flyTo(coord[0], coord[1], 12)
}
}
loading.value = true
searched.value = true
activePoi.value = null