ameliabooking
/
v3
/
src
/
views
/
public
/
StepForm
/
Congratulations
/
parts
/
AppointmentInfoService.vue
AppointmentInfoService.vue
1 month ago
CartInfoService.vue
1 month ago
PackageInfoService.vue
1 month ago
AppointmentInfoService.vue
73 lines
| 1 | <template> |
| 2 | <div class="am-fs__congrats-info-app-date"> |
| 3 | <span>{{ amLabels.congrats_date }}:</span> |
| 4 | <span>{{ getFrontedFormattedDate(date) }}</span> |
| 5 | </div> |
| 6 | <div class="am-fs__congrats-info-app-time"> |
| 7 | <span>{{ amLabels.congrats_time }}:</span> |
| 8 | <span>{{ getFrontedFormattedTime(useFormatTime(time)) }}</span> |
| 9 | </div> |
| 10 | <div class="am-fs__congrats-info-app-service"> |
| 11 | <span>{{ amLabels.congrats_service }}:</span> |
| 12 | <span>{{ bookable ? bookable.name : '' }}</span> |
| 13 | </div> |
| 14 | <div class="am-fs__congrats-info-app-employee"> |
| 15 | <span>{{ amLabels.congrats_employee }}:</span> |
| 16 | <span>{{ employee ? employee.firstName + ' ' + employee.lastName : '' }}</span> |
| 17 | </div> |
| 18 | <div v-if="location" class="am-fs__congrats-info-app-location"> |
| 19 | <span>{{ amLabels.congrats_location }}:</span> |
| 20 | <span>{{ location.address ? location.address : location.name }}</span> |
| 21 | </div> |
| 22 | <div v-if="booked.data.length > 1" class="am-fs__congrats-info-app-recurring"> |
| 23 | <span>{{ amLabels.recurring }}:</span> |
| 24 | <span>{{ amLabels.appointment_repeats }} x{{ booked.data.length }}</span> |
| 25 | </div> |
| 26 | </template> |
| 27 | |
| 28 | <script setup> |
| 29 | import { computed, inject } from 'vue' |
| 30 | import { useStore } from 'vuex' |
| 31 | import { |
| 32 | getFrontedFormattedTime, |
| 33 | getFrontedFormattedDate, |
| 34 | useFormatTime, |
| 35 | } from '../../../../../assets/js/common/date' |
| 36 | |
| 37 | const store = useStore() |
| 38 | |
| 39 | const amLabels = inject('amLabels') |
| 40 | |
| 41 | let booked = inject('booked') |
| 42 | |
| 43 | let date = computed(() => (booked.value ? booked.value.data[0].start.split(' ')[0] : '')) |
| 44 | |
| 45 | let time = computed(() => (booked.value ? booked.value.data[0].start.split(' ')[1] : '')) |
| 46 | |
| 47 | let bookable = computed(() => { |
| 48 | return booked.value |
| 49 | ? store.getters['entities/getServices'].find((i) => i.id === booked.value.data[0].serviceId) |
| 50 | : null |
| 51 | }) |
| 52 | |
| 53 | let employee = computed(() => { |
| 54 | return booked.value |
| 55 | ? store.getters['entities/getEmployees'].find((i) => i.id === booked.value.data[0].providerId) |
| 56 | : null |
| 57 | }) |
| 58 | |
| 59 | let location = computed(() => { |
| 60 | return booked.value && booked.value.data[0].locationId |
| 61 | ? store.getters['entities/getLocations'].find((i) => i.id === booked.value.data[0].locationId) |
| 62 | : null |
| 63 | }) |
| 64 | </script> |
| 65 | |
| 66 | <script> |
| 67 | export default { |
| 68 | name: 'AppointmentInfoService', |
| 69 | } |
| 70 | </script> |
| 71 | |
| 72 | <style lang="scss"></style> |
| 73 |