Răsfoiți Sursa

fix: :bug: fix(ajuste nos preços) Foi ajustado a lisatgem de preço no agendamento,tambem ajustado a questão do cadastro do cartão

Foi ajustado o preço na parte de agendamentos onde havia sido retirado e agora voltou com a opção para visualização do cliente, tambem foi ajustado a questão do cadastro do cartão onde antes cadastrava no formato mes/ano completo agora cadastra no formato ex: 02/27, tambem ajustado a questão do cvv onde agora na hora do cadastro e possivel visualizar o numero

origin: bug-interno
kayo henrique 5 zile în urmă
părinte
comite
e73018340b

+ 16 - 7
src/components/profile/ProfilePaymentAddDialog.vue

@@ -123,7 +123,7 @@
                 class="col bg-surface input-border-dark"
                 hide-bottom-space
                 input-class="text-text"
-                mask="##/####"
+                mask="##/##"
                 outlined
                 :error="!!serverErrors.expiration"
                 :error-message="serverErrors.expiration"
@@ -159,7 +159,7 @@
                 mask="####"
                 outlined
                 placeholder="***"
-                type="password"
+                type="text"
                 unmasked-value
                 :error="!!serverErrors.cvv"
                 :error-message="serverErrors.cvv"
@@ -426,17 +426,26 @@ const validateExpiration = (val) => {
     return true;
   }
 
-  if (!validateCardExpiration(val)) {
-    return t('profile.payments.expired_card');
+  const [month, year] = val.split("/");
+
+  if (!month || !year) {
+    return t("profile.payments.expired_card");
   }
 
-  return true;
+  return validateCardExpiration(`${month}/20${year}`)
+    ? true
+    : t("profile.payments.expired_card");
 };
 
 //
 
 const onOKClick = async () => {
   const valid = await formRef.value?.validate();
+  const expirationFormatted = (() => {
+  const [month, year] = form.expiration.split("/");
+
+  return `${month}/20${year}`;
+})();
 
   if (!valid) {
     return;
@@ -447,7 +456,7 @@ const onOKClick = async () => {
       brand: form.brand,
       card_name: form.card_name,
       client_id: props.paymentMethod ? props.paymentMethod.client_id : props.clientId,
-      expiration: form.expiration,
+      expiration: expirationFormatted,
       holder_name: form.holder_name,
       is_active: form.is_active,
       last_four_digits: form.last_four_digits,
@@ -465,7 +474,7 @@ const onOKClick = async () => {
 
     const payload = {
       client_id: props.paymentMethod ? props.paymentMethod.client_id : props.clientId,
-      expiration: form.expiration,
+      expiration: expirationFormatted,
       holder_name: form.holder_name,
       last_four_digits: form.last_four_digits,
       token,

+ 22 - 0
src/pages/search/components/ServiceSelectionSheet.vue

@@ -54,6 +54,13 @@
             </div>
           </div>
 
+           <div
+              v-if="type.price"
+               class="service-price"
+            >
+              {{ formatCurrency(type.price) }}
+            </div>
+
           <div class="row no-wrap q-gutter-x-xs">
             <q-btn
               color="secondary"
@@ -75,6 +82,7 @@
 <script setup>
 import { computed } from "vue";
 import { useDialogPluginComponent, useQuasar } from "quasar";
+import { formatCurrency } from "src/helpers/utils";
 import { useI18n } from "vue-i18n";
 
 import ServiceTypeInfoDialog from "./ServiceTypeInfoDialog.vue";
@@ -174,4 +182,18 @@ const openInfo = (type) => {
 .sheet-card {
   border-radius: 20px 20px 0 0;
 }
+
+.service-price {
+  min-width: 88px;
+  margin: 0 20px;
+  text-align: right;
+
+  font-size: 18px;
+  font-weight: 700;
+  color: var(--q-text);
+}
+
+.service-btn {
+  min-width: 82px;
+}
 </style>