ソースを参照

feat: ✨ feat (fluxo agendamento) pacote de agendamento e carrinho

alterado funcionamento do pacote de agendamentos e carrinho para so permitir mais de um agendamento no carrinho se for do mesmo prestador + bloco novo na dashboard para indicar que ha agendamentos sendo solicitados para o prestador + animacoes no bloco 'realize pagamento' e 'solicitando agendamento'

fase:dev | origin:escopo
Gustavo Zanatta 10 時間 前
コミット
2cd9d6b58f

+ 38 - 1
src/components/dashboard/ScheduleCancelDialog.vue

@@ -25,6 +25,24 @@
         </div>
       </q-card-section>
 
+      <q-card-section
+        v-if="packageWarning"
+        class="q-pt-none q-pb-sm q-px-lg"
+      >
+        <div class="package-warning-box row no-wrap q-gutter-x-sm q-pa-sm">
+          <q-icon
+            class="q-mt-xs flex-shrink-0"
+            color="negative"
+            name="mdi-package-variant"
+            size="22px"
+          />
+
+          <span class="font13 fontbold text-negative">
+            {{ packageWarning }}
+          </span>
+        </div>
+      </q-card-section>
+
       <q-card-section class="q-pt-none q-pb-sm q-px-lg">
         <div class="text-grey-8 font14 fontbold q-mb-xs">
           {{ $t('provider.dashboard.cancel_schedule.reason_label') }}
@@ -103,7 +121,7 @@
 import { cancelSchedule } from 'src/api/schedule'
 import { useDialogPluginComponent, useQuasar } from 'quasar'
 import { useI18n } from 'vue-i18n'
-import { ref } from 'vue'
+import { computed, ref } from 'vue'
 
 const props = defineProps({
   schedule: {
@@ -119,6 +137,20 @@ const $q = useQuasar()
 const cancelText = ref('')
 const loading = ref(false)
 
+const packageWarning = computed(() => {
+  if (!props.schedule?.service_package_id) return null
+
+  const count = props.schedule?.package_items?.length
+
+  if (count > 1) {
+    return t('provider.dashboard.cancel_schedule.package_warning', { count })
+  }
+
+  if (count === 1) return null
+
+  return t('provider.dashboard.cancel_schedule.package_warning_generic')
+})
+
 const confirmCancel = async () => {
   if (!cancelText.value || cancelText.value.trim().length < 5) return
 
@@ -153,6 +185,11 @@ const confirmCancel = async () => {
   border-radius: 10px;
 }
 
+.package-warning-box {
+  background: #fdecec;
+  border-radius: 10px;
+}
+
 .btn-action {
   min-width: 110px;
 }

+ 2 - 0
src/i18n/locales/en.json

@@ -400,6 +400,8 @@
         "warning_after": " of your profile in the app.",
         "btn_cancel": "Back",
         "btn_keep": "Cancel the service",
+        "package_warning": "This booking is part of a package with {count} bookings. Cancelling it will cancel ALL upcoming bookings in the package.",
+        "package_warning_generic": "This booking is part of a package. Cancelling it will cancel ALL upcoming bookings in the package.",
         "service_fee": "Service fee",
         "total": "Total to receive:",
         "close": "Close",

+ 2 - 0
src/i18n/locales/es.json

@@ -400,6 +400,8 @@
         "warning_after": " de su perfil en la aplicación.",
         "btn_cancel": "Cancelar el servicio",
         "btn_keep": "Volver",
+        "package_warning": "Esta reserva forma parte de un paquete con {count} reservas. Al cancelarla, se cancelarán TODAS las reservas futuras del paquete.",
+        "package_warning_generic": "Esta reserva forma parte de un paquete. Al cancelarla, se cancelarán TODAS las reservas futuras del paquete.",
         "service_fee": "Tarifa de servicio",
         "total": "Total a recibir:",
         "close": "Cerrar",

+ 2 - 0
src/i18n/locales/pt.json

@@ -400,6 +400,8 @@
         "warning_after": " do seu perfil no aplicativo.",
         "btn_cancel": "Voltar",
         "btn_keep": "Cancelar o serviço",
+        "package_warning": "Este agendamento faz parte de um pacote com {count} agendamentos. Ao cancelar, TODOS os agendamentos futuros do pacote serão cancelados.",
+        "package_warning_generic": "Este agendamento faz parte de um pacote. Ao cancelar, TODOS os agendamentos futuros do pacote serão cancelados.",
         "service_fee": "Taxa de serviço",
         "total": "Total a receber:",
         "close": "Fechar",