карты пвз
All checks were successful
Deploy / build (push) Successful in 56s

This commit is contained in:
alsaze 2025-11-11 18:21:20 +03:00
parent 742ebb4e74
commit 55103d3778
2 changed files with 11 additions and 2 deletions

View File

@ -84,8 +84,9 @@ import {
const props = defineProps<{ modelValue: PickupPoint, pickupPoints: PickupPoint[] }>() const props = defineProps<{ modelValue: PickupPoint, pickupPoints: PickupPoint[] }>()
defineEmits<{ const emit = defineEmits<{
(e: 'update:modelValue', value: PickupPoint | undefined): void (e: 'update:modelValue', value: PickupPoint | undefined): void
(e: 'activeTab', value: string): void
}>() }>()
const { coords } = useGeolocation() const { coords } = useGeolocation()
@ -99,7 +100,7 @@ const tabs = computed<TabsItem[]>(() =>
[ [
{ {
value: 'map', value: 'map',
label: activeTab.value === 'map' || activeTab.value === undefined ? 'Карта' : '', label: activeTab.value === 'map' ? 'Карта' : '',
icon: 'lucide:map-pin', icon: 'lucide:map-pin',
slot: 'map' as const, slot: 'map' as const,
}, },
@ -135,6 +136,10 @@ watch(() => props.modelValue, (newPickupPoint) => {
duration: 500, duration: 500,
} }
}) })
watch(() => activeTab.value, (newActiveTab) => {
emit('activeTab', newActiveTab)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -25,10 +25,13 @@
</template> </template>
</UDrawer> </UDrawer>
activeTab
{{ activeTab }}
<!-- Desktop Mobile --> <!-- Desktop Mobile -->
<PvzMap <PvzMap
v-model="checkoutPickupPoint" v-model="checkoutPickupPoint"
:pickup-points="filteredPoints" :pickup-points="filteredPoints"
@active-tab="value => activeTab = value"
@update:model-value="updatePoint()" @update:model-value="updatePoint()"
/> />
</div> </div>
@ -49,6 +52,7 @@ const open = ref(false)
const isMobile = useMediaQuery('(max-width: 1280px)') const isMobile = useMediaQuery('(max-width: 1280px)')
const yandexPvz = ref<YandexPvzResponse>() const yandexPvz = ref<YandexPvzResponse>()
const searchTerm = ref('') const searchTerm = ref('')
const activeTab = ref()
const waitForCoords = () => const waitForCoords = () =>
new Promise<void>((resolve) => { new Promise<void>((resolve) => {