This commit is contained in:
@@ -383,7 +383,7 @@ const topTabFromHash = () => {
|
||||
const launchOverlayMinDisplayMs = 700
|
||||
const launchOverlayGuideTimeoutMs = 12000
|
||||
const launchOverlayNonGuideTimeoutMs = 900
|
||||
const launchOverlayDefaultText = '正在进入自然导览'
|
||||
const launchOverlayDefaultText = '正在进入智能导览'
|
||||
|
||||
const shouldShowLaunchOverlay = () => {
|
||||
if (typeof window === 'undefined') return false
|
||||
|
||||
@@ -133,13 +133,9 @@ const dedupePoisById = (pois: MuseumPoi[]) => {
|
||||
|
||||
const getPoiSpaceIdentity = (poi: MuseumPoi) => poi.sourceSpaceId || poi.spaceId || ''
|
||||
|
||||
const getPoiLookupIdentities = (id: string) => {
|
||||
const normalizedId = id.trim()
|
||||
return new Set([
|
||||
normalizedId,
|
||||
normalizedId.replace(/^(?:hall|space)-/, '')
|
||||
].filter(Boolean))
|
||||
}
|
||||
const getPoiSourceLookupIdentity = (id: string) => (
|
||||
id.trim().replace(/^(?:hall|space)-/, '')
|
||||
)
|
||||
|
||||
const mergePoiCategories = (...categoryGroups: MuseumCategory[][]) => {
|
||||
const seenIds = new Set<string>()
|
||||
@@ -553,12 +549,18 @@ export class SgsSdkGuideRepository implements GuideRepository {
|
||||
|
||||
async getPoiById(id: string) {
|
||||
const pois = await this.searchPois()
|
||||
const lookupIdentities = getPoiLookupIdentities(id)
|
||||
return pois.find((poi) => (
|
||||
lookupIdentities.has(poi.id)
|
||||
|| lookupIdentities.has(poi.spaceId || '')
|
||||
|| lookupIdentities.has(poi.sourceSpaceId || '')
|
||||
))
|
||||
const normalizedId = id.trim()
|
||||
const exactPoi = pois.find((poi) => poi.id === normalizedId)
|
||||
if (exactPoi) return exactPoi
|
||||
|
||||
const sourceIdentity = getPoiSourceLookupIdentity(normalizedId)
|
||||
const sourcePoi = sourceIdentity
|
||||
? pois.find((poi) => (
|
||||
poi.spaceId === sourceIdentity
|
||||
|| poi.sourceSpaceId === sourceIdentity
|
||||
))
|
||||
: undefined
|
||||
return sourcePoi
|
||||
|| findPoiByNavIdNameFallback(pois, id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user