Radio.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <f7-page name="radio">
  3. <img :src="Radio.logo" id="logo" />
  4. <f7-block-title>{{ Radio.name }}</f7-block-title>
  5. <f7-block-header>{{ Radio.description }}</f7-block-header>
  6. <div v-if="loading" strong class="text-align-center">
  7. <f7-preloader v-if="loading" />
  8. </div>
  9. <f7-list v-else>
  10. <f7-list-item
  11. title="Diretta"
  12. :link="`/radio/${encodeURIComponent(radioUrl)}/live`"
  13. />
  14. <f7-list-item
  15. title="Trasmissioni"
  16. :link="`/radio/${encodeURIComponent(radioUrl)}/shows`"
  17. />
  18. <f7-list-item
  19. title="Contatti"
  20. :link="`/radio/${encodeURIComponent(radioUrl)}/contacts`"
  21. disabled
  22. />
  23. </f7-list>
  24. </f7-page>
  25. </template>
  26. <script>
  27. import radiomanifest from "../js/radiomanifest";
  28. export default {
  29. name: "radio",
  30. data() {
  31. return {
  32. loading: true,
  33. radioUrl: null,
  34. radio: { name: "" },
  35. Radio: {},
  36. };
  37. },
  38. props: { f7route: Object, f7router: Object },
  39. async mounted() {
  40. this.radioUrl = decodeURIComponent(this.f7route.params.radioUrl);
  41. try {
  42. this.Radio = await radiomanifest.get(this.radioUrl);
  43. this.loading = false;
  44. } catch (e) {
  45. console.error("le cose non vanno mai sempre bene!", e);
  46. }
  47. },
  48. };
  49. </script>
  50. <style>
  51. #logo {
  52. margin-left: 10px;
  53. max-width: 40px;
  54. }
  55. </style>