events.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <v-container fluid>
  3. <v-row>
  4. <!-- Bloc événements -->
  5. <v-col cols="12" md="8">
  6. <v-card>
  7. <v-tabs v-model="tab">
  8. <v-tab value="future">À venir</v-tab>
  9. <v-tab value="past">Passés</v-tab>
  10. </v-tabs>
  11. <v-tabs-window v-model="tab">
  12. <v-tabs-window-item value="future">
  13. <UiEventList
  14. :events="upcomingEvents"
  15. @load-next="loadNextUpcoming"
  16. @load-prev="loadPrevUpcoming"
  17. @edit="editEvent"
  18. @delete="deleteEvent"
  19. />
  20. </v-tabs-window-item>
  21. <v-tabs-window-item value="past">
  22. <UiEventList
  23. :events="pastEvents"
  24. @load-next="loadNextPast"
  25. @load-prev="loadPrevPast"
  26. @edit="editEvent"
  27. @delete="deleteEvent"
  28. />
  29. </v-tabs-window-item>
  30. </v-tabs-window>
  31. <v-card-actions>
  32. <v-btn color="primary" @click="addEvent">Ajouter un événement</v-btn>
  33. </v-card-actions>
  34. </v-card>
  35. </v-col>
  36. <!-- Bloc structure -->
  37. <v-col cols="12" md="4">
  38. <v-card>
  39. <v-card-title>Structure</v-card-title>
  40. <v-card-text>
  41. <div><strong>Nom:</strong> {{ structure.name }}</div>
  42. <div><strong>Adresse:</strong> {{ structure.address }}</div>
  43. <div><strong>Email:</strong> {{ structure.email }}</div>
  44. </v-card-text>
  45. <v-card-actions>
  46. <v-btn color="secondary" @click="editStructure">Modifier la structure</v-btn>
  47. </v-card-actions>
  48. </v-card>
  49. </v-col>
  50. </v-row>
  51. </v-container>
  52. </template>
  53. <script setup lang="ts">
  54. definePageMeta({
  55. name: 'freemium_events_page',
  56. })
  57. import { ref } from 'vue'
  58. const tab = ref(null)
  59. // Pagination state
  60. const upcomingPage = ref(1)
  61. const pastPage = ref(1)
  62. const upcomingEvents = ref<Event[]>([{
  63. 'id': 1,
  64. 'name': "Mon événement",
  65. 'date': "2025/10/25",
  66. 'location': "Cluses",
  67. 'image': "https://www.ville-lecastellet.fr/wp-content/uploads/sites/2/2022/04/declaration-devenements.jpg"
  68. },
  69. {
  70. 'id': 2,
  71. 'name': "Noel",
  72. 'date': "2025/12/25",
  73. 'location': "Thyez",
  74. 'image': "https://www.maisonvictor.fr/img/cms/sapin%20de%20noel.jpg"
  75. }
  76. ])
  77. const pastEvents = ref<Event[]>([{
  78. 'id': 3,
  79. 'name': "Musique en stock",
  80. 'date': "2025/07/03",
  81. 'location': "Scionzier",
  82. 'image': "https://musiquesenstock.fr/wp-content/uploads/MES2025_AFF_H-1024x695.jpg"
  83. }])
  84. const structure = ref({
  85. name: 'École de musique Demo',
  86. address: '123 rue de la Musique',
  87. email: 'contact@musique.fr'
  88. })
  89. function loadNextUpcoming() {
  90. upcomingPage.value++
  91. fetchUpcoming()
  92. }
  93. function loadPrevUpcoming() {
  94. if (upcomingPage.value > 1) upcomingPage.value--
  95. fetchUpcoming()
  96. }
  97. function loadNextPast() {
  98. pastPage.value++
  99. fetchPast()
  100. }
  101. function loadPrevPast() {
  102. if (pastPage.value > 1) pastPage.value--
  103. fetchPast()
  104. }
  105. function fetchUpcoming() {
  106. // TODO: call API with page=upcomingPage
  107. console.log('fetch upcoming events page', upcomingPage.value)
  108. }
  109. function fetchPast() {
  110. // TODO: call API with page=pastPage
  111. console.log('fetch past events page', pastPage.value)
  112. }
  113. function editEvent(eventId: number) {
  114. // TODO: navigate to event edit page
  115. console.log('edit event', eventId)
  116. }
  117. function deleteEvent(eventId: number) {
  118. // TODO: call delete API then refresh
  119. console.log('delete event', eventId)
  120. }
  121. function addEvent() {
  122. // TODO: navigate to add event page
  123. console.log('add new event')
  124. }
  125. function editStructure() {
  126. // TODO: navigate to edit structure page
  127. console.log('edit structure')
  128. }
  129. </script>
  130. <style scoped>
  131. .v-card {
  132. margin-bottom: 16px;
  133. }
  134. </style>