Radio.vue 1.4 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 { useRadioStore } from "../js/store";
  28. import { storeToRefs } from "pinia";
  29. export default {
  30. name: "radio",
  31. data() {
  32. return {
  33. isRadioReady: null,
  34. radioUrl: null,
  35. radio: { name: "" },
  36. Radio: {},
  37. store: useRadioStore(),
  38. loading: () => {return this.isRadioReady === null || !this.isRadioReady(this.radioUrl)}
  39. };
  40. },
  41. props: { f7route: Object, f7router: Object },
  42. async mounted() {
  43. this.radioUrl = decodeURIComponent(this.f7route.params.radioUrl);
  44. const { isRadioReady } = storeToRefs(this.store);
  45. this.isRadioReady = isRadioReady;
  46. },
  47. };
  48. </script>
  49. <style>
  50. #logo {
  51. margin-left: 10px;
  52. max-width: 40px;
  53. }
  54. </style>