forked from zhouruizhe/gmTouringMiniApp
Add check-in feature and update travel planner UI
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { getPoiRepository } from '@/data/poi'
|
||||
import { CHECK_IN_RADIUS_METERS } from '@/domain/check-in'
|
||||
|
||||
export interface CheckInTask {
|
||||
poiId: string
|
||||
radiusMeters: number
|
||||
status: 'poc_enabled'
|
||||
verificationNote: string
|
||||
}
|
||||
|
||||
function createCheckInTask(poiId: string): CheckInTask {
|
||||
return {
|
||||
poiId,
|
||||
radiusMeters: CHECK_IN_RADIUS_METERS,
|
||||
status: 'poc_enabled',
|
||||
verificationNote: 'POC 开放点位,正式发布前需在 iOS 真机复核游客入口坐标与安全到达区域。',
|
||||
}
|
||||
}
|
||||
|
||||
export function getCheckInTask(poiId: string): CheckInTask | null {
|
||||
const normalizedPoiId = poiId.trim()
|
||||
if (!normalizedPoiId || !getPoiRepository().getPoiById(normalizedPoiId))
|
||||
return null
|
||||
return createCheckInTask(normalizedPoiId)
|
||||
}
|
||||
|
||||
export function getCheckInTasks(): CheckInTask[] {
|
||||
return getPoiRepository()
|
||||
.getPublishedPois()
|
||||
.map(poi => createCheckInTask(poi.id))
|
||||
}
|
||||
Reference in New Issue
Block a user