SchedulePaymentProcessingDialog.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <q-dialog ref="dialogRef" persistent maximized transition-show="fade" transition-hide="fade" @hide="onDialogHide">
  3. <div class="bg-surface full-height column items-center justify-center q-px-xl">
  4. <template v-if="!success">
  5. <q-spinner-oval color="primary" size="72px" class="q-mb-lg" />
  6. <div class="processing-title text-primary text-weight-bold text-center q-mb-sm">
  7. {{ $t('payment.processing_title') }}
  8. </div>
  9. <div class="processing-message text-grey-6 text-center">
  10. {{ $t('payment.processing_message') }}
  11. </div>
  12. </template>
  13. <template v-else>
  14. <q-btn
  15. flat
  16. round
  17. icon="mdi-close"
  18. color="grey-5"
  19. class="self-end q-mb-md"
  20. @click="onDialogOK"
  21. />
  22. <img
  23. src="/logo_diaria_branco.svg"
  24. alt="mascote"
  25. class="success-mascot q-mb-lg"
  26. style="display:none"
  27. />
  28. <div class="success-icon-wrapper q-mb-lg">
  29. <q-icon name="mdi-check-circle" size="100px" color="primary" />
  30. </div>
  31. <div class="success-title text-primary text-weight-bold text-center q-mb-sm">
  32. {{ $t('payment.success_title') }}
  33. </div>
  34. <i18n-t keypath="payment.success_message" tag="div" class="success-message text-grey-6 text-center">
  35. <template #nextServices>
  36. <strong class="text-text">{{ $t('payment.success_next_services') }}</strong>
  37. </template>
  38. <template #agenda>
  39. <strong class="text-text">{{ $t('payment.success_agenda') }}</strong>
  40. </template>
  41. </i18n-t>
  42. </template>
  43. </div>
  44. </q-dialog>
  45. </template>
  46. <script setup>
  47. import { ref, onMounted } from 'vue'
  48. import { useDialogPluginComponent } from 'quasar'
  49. import { updateScheduleStatus } from 'src/api/schedule'
  50. const props = defineProps({
  51. schedule: { type: Object, required: true },
  52. })
  53. defineEmits([...useDialogPluginComponent.emits])
  54. const { dialogRef, onDialogHide, onDialogOK } = useDialogPluginComponent()
  55. const success = ref(false)
  56. onMounted(async () => {
  57. await new Promise(resolve => setTimeout(resolve, 4000))
  58. try {
  59. await updateScheduleStatus(props.schedule.id, 'paid')
  60. } catch (e) {
  61. console.error('Erro ao atualizar status:', e)
  62. }
  63. success.value = true
  64. })
  65. </script>
  66. <style scoped lang="scss">
  67. .processing-title {
  68. font-size: 22px;
  69. line-height: 1.3;
  70. }
  71. .processing-message {
  72. font-size: 15px;
  73. line-height: 1.5;
  74. max-width: 280px;
  75. }
  76. .success-icon-wrapper {
  77. display: flex;
  78. align-items: center;
  79. justify-content: center;
  80. }
  81. .success-title {
  82. font-size: 24px;
  83. line-height: 1.3;
  84. max-width: 280px;
  85. }
  86. .success-message {
  87. font-size: 14px;
  88. line-height: 1.6;
  89. max-width: 280px;
  90. }
  91. </style>