feat: add merged venue navigation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="venue-select-page">
|
||||
<view v-if="isReady" class="venue-select-page">
|
||||
<view class="header">
|
||||
<text class="title">选择场馆</text>
|
||||
<text class="subtitle">进入对应场馆后,会员、预约、订单和支付数据彼此独立。</text>
|
||||
@@ -32,17 +32,27 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useVenueStore } from '@/stores/venue'
|
||||
import { VENUE_OPTIONS } from '@/utils/venue'
|
||||
import { VENUE_OPTIONS, navigateToVenueHome } from '@/utils/venue'
|
||||
|
||||
const venueStore = useVenueStore()
|
||||
const venues = VENUE_OPTIONS
|
||||
const isReady = ref(false)
|
||||
const currentVenue = computed(() => venueStore.currentVenue)
|
||||
const selectedVenue = computed(() => venueStore.currentVenueOption)
|
||||
|
||||
onMounted(() => {
|
||||
venueStore.init()
|
||||
onLoad((options) => {
|
||||
const storedVenue = venueStore.init()
|
||||
const isSwitchMode = options?.mode === 'switch'
|
||||
|
||||
if (storedVenue && !isSwitchMode) {
|
||||
navigateToVenueHome(storedVenue)
|
||||
return
|
||||
}
|
||||
|
||||
isReady.value = true
|
||||
})
|
||||
|
||||
const selectVenue = (venueKey) => {
|
||||
|
||||
Reference in New Issue
Block a user