feat: add merged venue navigation

This commit is contained in:
gqt
2026-06-08 21:42:32 +08:00
parent 845385c3b9
commit 4c20371c6d
13 changed files with 245 additions and 8 deletions
@@ -0,0 +1,35 @@
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, resolve } from 'node:path'
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const srcRoot = resolve(root, 'src')
const failures = []
const read = (relativePath) => readFileSync(resolve(srcRoot, relativePath), 'utf8')
const expectIncludes = (content, expected, label) => {
if (!content.includes(expected)) failures.push(`${label} is missing: ${expected}`)
}
const venueSelect = read('pages/venue-select/index.vue')
expectIncludes(venueSelect, '<view v-if="isReady" class="venue-select-page">', 'venue-select template')
expectIncludes(venueSelect, "import { onLoad } from '@dcloudio/uni-app'", 'venue-select imports')
expectIncludes(venueSelect, "import { VENUE_OPTIONS, navigateToVenueHome } from '@/utils/venue'", 'venue-select imports')
expectIncludes(venueSelect, "const isSwitchMode = options?.mode === 'switch'", 'venue-select onLoad guard')
expectIncludes(venueSelect, 'if (storedVenue && !isSwitchMode) {', 'venue-select stored venue guard')
expectIncludes(venueSelect, 'navigateToVenueHome(storedVenue)', 'venue-select stored venue redirect')
expectIncludes(venueSelect, 'isReady.value = true', 'venue-select ready flag')
const iceProfile = read('pages/ice/profile/index.vue')
expectIncludes(iceProfile, "navigateTo('/pages/venue-select/index?mode=switch')", 'ice profile switch entry')
const comprehensiveProfile = read('pages/comprehensive/profile/index.vue')
expectIncludes(comprehensiveProfile, "url: '/pages/venue-select/index?mode=switch'", 'comprehensive profile switch entry')
if (failures.length) {
console.error(`Venue startup verification failed with ${failures.length} issue(s):`)
for (const failure of failures) console.error(`- ${failure}`)
process.exit(1)
}
console.log('Venue startup verification passed.')