Working on exercise 1.2
This commit is contained in:
@@ -32,6 +32,7 @@ async function startLogin() {
|
||||
v-model="accountStore.loginData.username"
|
||||
variant="outlined"
|
||||
clearable
|
||||
@keyup.enter="startLogin"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -45,6 +46,7 @@ async function startLogin() {
|
||||
variant="outlined"
|
||||
v-model="accountStore.loginData.password"
|
||||
clearable
|
||||
@keyup.enter="startLogin"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useConcertStore } from '@/stores/concert.store';
|
||||
import { useBandStore } from '@/stores/band.store';
|
||||
import { useAccountStore } from '@/stores/account.store';
|
||||
import { useLocationStore } from '@/stores/location.store';
|
||||
import { useExerciseStore } from '@/stores/exercise.store';
|
||||
import { useGenreStore } from '@/stores/genre.store';
|
||||
import { usePreferencesStore } from '@/stores/preferences.store';
|
||||
import dashboardCard from './dashboardCard.vue';
|
||||
@@ -15,13 +14,10 @@ const bandStore = useBandStore()
|
||||
const accountStore = useAccountStore()
|
||||
const genreStore = useGenreStore()
|
||||
const locationStore = useLocationStore()
|
||||
const exerciseStore = useExerciseStore()
|
||||
const preferencesStore = usePreferencesStore()
|
||||
const orderStore = useOrderStore()
|
||||
const filesStore = useFilesStore()
|
||||
|
||||
exerciseStore.solveExercise(2, 1)
|
||||
|
||||
filesStore.getStaticFolders()
|
||||
bandStore.getBands()
|
||||
locationStore.getLocations()
|
||||
|
||||
@@ -20,15 +20,17 @@ const bandStore = useBandStore()
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-for="concert of bandStore.band.concerts">
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="bandStore.band"
|
||||
:location="concert.location"
|
||||
:title="concert.location.city.name"
|
||||
:link="concert.inStock > 0"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<div v-for="concert of bandStore.band.concerts">
|
||||
<v-row v-if="concert.offered">
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="bandStore.band"
|
||||
:location="concert.location"
|
||||
:title="concert.location.city.name"
|
||||
:link="concert.inStock > 0"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,11 +15,17 @@ const basketStore = useBasketStore()
|
||||
const concertStore = useConcertStore()
|
||||
|
||||
onMounted(async () => {
|
||||
concertStore.getConcert(Number(router.currentRoute.value.params.id))
|
||||
concertStore.getConcert(
|
||||
String(router.currentRoute.value.params.locationUrl),
|
||||
String(router.currentRoute.value.params.date)
|
||||
)
|
||||
})
|
||||
|
||||
watch(() => router.currentRoute.value.params.id, () => {
|
||||
concertStore.getConcert(Number(router.currentRoute.value.params.id))
|
||||
concertStore.getConcert(
|
||||
String(router.currentRoute.value.params.locationUrl),
|
||||
String(router.currentRoute.value.params.date)
|
||||
)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -24,26 +24,28 @@ const concertStore = useConcertStore()
|
||||
v-else-if="concertStore.concerts.length > 0"
|
||||
v-for="(concert, index) of concertStore.concerts"
|
||||
>
|
||||
<v-row
|
||||
v-if="index == 0 ||
|
||||
new Date(concertStore.concerts[index - 1].date).getMonth() !=
|
||||
new Date(concertStore.concerts[index].date).getMonth()"
|
||||
>
|
||||
<v-col>
|
||||
<section-divider
|
||||
:title="new Date(concert.date).toLocaleString('default', { month: 'long' }) + ' ' + new Date(concert.date).getFullYear()"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<div v-if="concert.offered">
|
||||
<v-row
|
||||
v-if="index == 0 ||
|
||||
new Date(concertStore.concerts[index - 1].date).getMonth() !=
|
||||
new Date(concertStore.concerts[index].date).getMonth()"
|
||||
>
|
||||
<v-col>
|
||||
<section-divider
|
||||
:title="new Date(concert.date).toLocaleString('default', { month: 'long' }) + ' ' + new Date(concert.date).getFullYear()"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="concert.band"
|
||||
:location="concert.location"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="concert.band"
|
||||
:location="concert.location"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -23,23 +23,27 @@ const locationStore = useLocationStore()
|
||||
</v-row>
|
||||
|
||||
<!-- Show concerts after fetching -->
|
||||
<v-row
|
||||
<div
|
||||
v-else-if="locationStore.location.concerts.length > 0"
|
||||
v-for="concert of locationStore.location.concerts"
|
||||
>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="concert.band"
|
||||
:location="locationStore.location"
|
||||
:title="concert.name"
|
||||
>
|
||||
<template #description>
|
||||
{{ concert.band.name }}
|
||||
</template>
|
||||
</concert-list-item>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row
|
||||
v-if="concert.offered"
|
||||
>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="concert.band"
|
||||
:location="locationStore.location"
|
||||
:title="concert.name"
|
||||
>
|
||||
<template #description>
|
||||
{{ concert.band.name }}
|
||||
</template>
|
||||
</concert-list-item>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
|
||||
<!-- Show empty state if no items there -->
|
||||
<v-row v-else>
|
||||
|
||||
Reference in New Issue
Block a user