修复首页浮层验收问题
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-05 23:27:17 +08:00
parent ad692e233a
commit a71994d490
3 changed files with 40 additions and 5 deletions

View File

@@ -242,6 +242,16 @@ const isPoiMatchingKeywords = (poi: MuseumPoi, keywords: string[]) => {
return keywords.some((keyword) => searchableText.includes(keyword.trim().toLowerCase()))
}
const findShortcutByKeyword = (keyword: string) => {
const normalized = keyword.trim().toLowerCase()
if (!normalized) return null
return [...primaryFacilities, ...serviceFacilities].find((shortcut) => (
shortcut.label.toLowerCase() === normalized
|| shortcut.keywords.some((item) => item.trim().toLowerCase() === normalized)
)) || null
}
const syncActiveFloor = () => {
if (!displayFloors.value.length) {
activeFloor.value = ''
@@ -367,6 +377,13 @@ const handleSearchConfirm = async (event?: any) => {
searchKeyword.value = value.trim()
searchDraftKeyword.value = searchKeyword.value
homeExpanded.value = true
const matchedShortcut = findShortcutByKeyword(searchKeyword.value)
if (matchedShortcut) {
await searchShortcut(matchedShortcut)
return
}
await loadPois(searchKeyword.value)
}
@@ -485,6 +502,11 @@ defineExpose({
gap: 8px;
overflow-x: auto;
padding-bottom: 2px;
scrollbar-width: none;
}
.home-category-strip::-webkit-scrollbar {
display: none;
}
.home-category-chip {