placeholder for Show

This commit is contained in:
boyska 2023-03-18 21:14:06 +00:00
parent d4edef72fa
commit 3e9299e77c
3 changed files with 51 additions and 17 deletions

View file

@ -14,7 +14,7 @@ var routes = [
component: RadioPage,
},
{
path: '/radio/:radioName/:showName',
path: '/radio/:radioId/shows/:showId',
component: ShowPage
}],
},

View file

@ -6,7 +6,7 @@
<f7-preloader v-if='loading' />
<f7-list v-else>
<f7-list-item v-for='show in Radio.shows' :key='show.name' :title='show.name' :link='`/radio/show/${show.name}`' :footer='show.description'/>
<f7-list-item v-for='show in Radio.shows' :key='show.name' :title='show.name' :link='`/radio/${radioId}/shows/${show.name}`' :footer='show.description'/>
</f7-list>
</f7-page>
</template>
@ -26,10 +26,10 @@ export default {
},
props: { f7route: Object, f7router: Object },
async mounted () {
this.radioId = this.f7route.params.radioName
try {
this.Radio = await radiomanifest.get(this.f7route.params.radioName)
// this.Radio.schedule.getNowShow(new Date())
console.error(this.Radio)
// console.log('got', this.Radio)
this.loading = false
} catch (e) {
console.error('le cose non vanno mai sempre bene!', e)

View file

@ -1,19 +1,53 @@
<script setup>
import radiomanifest from '../js/radiomanifest'
const { f7Route } = defineProps({ f7Route: Object })
const Radio = radiomanifest.currentRadio
// ma non c'e' Radio.schedule.getShowPodcast ?
</script>
<template>
<f7-page name="show">
<f7-block-title>{{Radio.name}}</f7-block-title>
<f7-block-header>{{Radio.description}}</f7-block-header>
<f7-preloader v-if='loading' />
<f7-block v-else>
<f7-block-title>{{Show.name}}</f7-block-title>
<f7-block-header>{{Radio.name}}</f7-block-header>
<f7-list>
<f7-list-item v-for='episode in Show.episodes' :key='episode.url' :title='episode.title' :link='`/radio/${radioId}/shows/${Show.name}/${episode.url}`' :footer='episode.text' />
</f7-list>
</f7-block>
</f7-page>
</template>
</template>
<script>
import radiomanifest from '../js/radiomanifest'
export default {
name: 'radio',
data () {
return {
loading: true,
radioId: null,
showId: null,
Show: null,
}
},
props: { f7route: Object, f7router: Object },
async mounted () {
this.radioId = this.f7route.params.radioId
this.showId = this.f7route.params.showId
// XXX: parse podcast
this.Show = {
episodes: [
{title: 'titolo1', text: 'foo1', 'url': '/asd1'},
{title: 'titolo2', text: 'foo2', 'url': '/asd2'},
],
name: this.showId,
}
console.log('show=', this.Show)
try {
this.Radio = await radiomanifest.get(this.f7route.params.radioId)
console.log('Radio=', this.Radio)
this.loading = false
} catch (e) {
console.error('le cose non vanno mai sempre bene!', e)
}
}
}
</script>