|
@@ -25,53 +25,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div v-else key="flow" class="flow-screen">
|
|
<div v-else key="flow" class="flow-screen">
|
|
|
- <div
|
|
|
|
|
- v-if="registrationCompleted"
|
|
|
|
|
- class="registration-flow"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="flow-header row items-center">
|
|
|
|
|
- <q-btn
|
|
|
|
|
- class="flow-back-btn"
|
|
|
|
|
- color="primary"
|
|
|
|
|
- dense
|
|
|
|
|
- flat
|
|
|
|
|
- round
|
|
|
|
|
- :aria-label="t('auth.logout')"
|
|
|
|
|
- icon="mdi-logout"
|
|
|
|
|
- @click="goBack"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="flow-logo q-my-xl">
|
|
|
|
|
- <q-img
|
|
|
|
|
- style="max-width: 180px"
|
|
|
|
|
- :src="LogoDiariaCampos"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="registration-complete">
|
|
|
|
|
- <div class="registration-complete__card row no-wrap items-start">
|
|
|
|
|
- <q-icon
|
|
|
|
|
- class="registration-complete__icon"
|
|
|
|
|
- name="mdi-clock-time-four-outline"
|
|
|
|
|
- size="32px"
|
|
|
|
|
- />
|
|
|
|
|
-
|
|
|
|
|
- <div class="registration-complete__content">
|
|
|
|
|
- <div class="registration-complete__title fontbold">
|
|
|
|
|
- {{ t("provider.login.registration_complete.title") }}
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="registration-complete__message font12">
|
|
|
|
|
- {{ t("provider.login.registration_complete.message") }}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
<q-form
|
|
<q-form
|
|
|
- v-else
|
|
|
|
|
ref="loginForm"
|
|
ref="loginForm"
|
|
|
autocapitalize="off"
|
|
autocapitalize="off"
|
|
|
autocomplete="off"
|
|
autocomplete="off"
|
|
@@ -186,7 +140,6 @@ import { useQuasar } from "quasar";
|
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
|
import { useScroll } from "src/composables/useScroll";
|
|
import { useScroll } from "src/composables/useScroll";
|
|
|
import { useSubmitHandler } from "src/composables/useSubmitHandler";
|
|
import { useSubmitHandler } from "src/composables/useSubmitHandler";
|
|
|
-import { userStore } from "src/stores/user";
|
|
|
|
|
|
|
|
|
|
import BackgroundLogin from "src/assets/background-login.svg";
|
|
import BackgroundLogin from "src/assets/background-login.svg";
|
|
|
import FotoDiarista from "src/assets/foto_diarista_login.svg";
|
|
import FotoDiarista from "src/assets/foto_diarista_login.svg";
|
|
@@ -201,8 +154,7 @@ import LoginStep6Panel from "src/components/login/LoginStep6Panel.vue";
|
|
|
|
|
|
|
|
const $q = useQuasar();
|
|
const $q = useQuasar();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
-const user = userStore();
|
|
|
|
|
-const { clearAuthData, logout, setAuthDataFromPayload } = useAuth();
|
|
|
|
|
|
|
+const { setAuthDataFromPayload } = useAuth();
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
const { scrollToComponent } = useScroll();
|
|
const { scrollToComponent } = useScroll();
|
|
|
|
|
|
|
@@ -263,16 +215,9 @@ const email = ref("");
|
|
|
const isLogin = ref(false);
|
|
const isLogin = ref(false);
|
|
|
const loginForm = ref(null);
|
|
const loginForm = ref(null);
|
|
|
const phone = ref("");
|
|
const phone = ref("");
|
|
|
-const registrationCompleted = ref(false);
|
|
|
|
|
const showSubStep = ref(false);
|
|
const showSubStep = ref(false);
|
|
|
const smsEnabled = ref(false);
|
|
const smsEnabled = ref(false);
|
|
|
|
|
|
|
|
-const isPendingProvider = computed(
|
|
|
|
|
- () =>
|
|
|
|
|
- String(user.user?.type).toUpperCase() === "PROVIDER" &&
|
|
|
|
|
- user.user?.provider?.approval_status === "pending",
|
|
|
|
|
-);
|
|
|
|
|
-
|
|
|
|
|
const createInitialStepFiveForm = () => ({
|
|
const createInitialStepFiveForm = () => ({
|
|
|
daily_price_2h: null,
|
|
daily_price_2h: null,
|
|
|
daily_price_4h: null,
|
|
daily_price_4h: null,
|
|
@@ -341,21 +286,11 @@ const actionLabel = computed(() => {
|
|
|
return t("provider.login.steps.step_3.action");
|
|
return t("provider.login.steps.step_3.action");
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const showBackButton = computed(
|
|
|
|
|
- () => registrationCompleted.value || steps.value >= 4,
|
|
|
|
|
-);
|
|
|
|
|
|
|
+const showBackButton = computed(() => steps.value >= 4);
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
const goBack = async () => {
|
|
const goBack = async () => {
|
|
|
- if (registrationCompleted.value) {
|
|
|
|
|
- await logout();
|
|
|
|
|
- await resetToLoginStart();
|
|
|
|
|
- router.replace({ name: "LoginPage" });
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (steps.value === 4) {
|
|
if (steps.value === 4) {
|
|
|
steps.value = 3;
|
|
steps.value = 3;
|
|
|
} else if (steps.value === 5) {
|
|
} else if (steps.value === 5) {
|
|
@@ -365,24 +300,6 @@ const goBack = async () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const resetToLoginStart = async () => {
|
|
|
|
|
- await clearAuthData();
|
|
|
|
|
-
|
|
|
|
|
- code.value = "";
|
|
|
|
|
- email.value = "";
|
|
|
|
|
- isLogin.value = false;
|
|
|
|
|
- phone.value = "";
|
|
|
|
|
- registrationCompleted.value = false;
|
|
|
|
|
- showSubStep.value = false;
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- stepFiveForm.value = createInitialStepFiveForm();
|
|
|
|
|
- stepFourForm.value = createInitialStepFourForm();
|
|
|
|
|
- stepSixForm.value = createInitialStepSixForm();
|
|
|
|
|
- stepThreeForm.value = createInitialStepThreeForm();
|
|
|
|
|
- steps.value = 1;
|
|
|
|
|
- loginForm.value?.resetValidation?.();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
const hasWorkingDaySelected = () => mapWorkingDays().length > 0;
|
|
const hasWorkingDaySelected = () => mapWorkingDays().length > 0;
|
|
@@ -431,7 +348,6 @@ const onValidationError = async (field) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const onSubmit = async () => {
|
|
const onSubmit = async () => {
|
|
|
- if (registrationCompleted.value) return;
|
|
|
|
|
if (showSubStep.value) return;
|
|
if (showSubStep.value) return;
|
|
|
|
|
|
|
|
const isValid = await loginForm.value.validate();
|
|
const isValid = await loginForm.value.validate();
|
|
@@ -638,7 +554,8 @@ const registerUserAndProvider = async () => {
|
|
|
|
|
|
|
|
if (response?.status >= 200 && response.status < 300) {
|
|
if (response?.status >= 200 && response.status < 300) {
|
|
|
await setAuthDataFromPayload(response.data.payload);
|
|
await setAuthDataFromPayload(response.data.payload);
|
|
|
- registrationCompleted.value = true;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ router.push({ name: "DashboardPage" });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return response;
|
|
return response;
|
|
@@ -674,12 +591,6 @@ const validateCodeInput = async () => {
|
|
|
if (isLogin.value === true) {
|
|
if (isLogin.value === true) {
|
|
|
await setAuthDataFromPayload(response.data.payload);
|
|
await setAuthDataFromPayload(response.data.payload);
|
|
|
|
|
|
|
|
- if (isPendingProvider.value) {
|
|
|
|
|
- registrationCompleted.value = true;
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
router.push({ name: "DashboardPage" });
|
|
router.push({ name: "DashboardPage" });
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
@@ -735,13 +646,6 @@ const validateCurrentStep = async () => {
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
loadServiceConfiguration();
|
|
loadServiceConfiguration();
|
|
|
|
|
|
|
|
- if (user.accessToken && isPendingProvider.value) {
|
|
|
|
|
- registrationCompleted.value = true;
|
|
|
|
|
- clicked.value = true;
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
clicked.value = true;
|
|
clicked.value = true;
|
|
|
}, 1500);
|
|
}, 1500);
|
|
@@ -879,49 +783,4 @@ onMounted(() => {
|
|
|
background: var(--q-surface-dark);
|
|
background: var(--q-surface-dark);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.registration-flow {
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- padding: 16px 20px;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.registration-complete {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- min-height: 0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- padding: 24px 0 80px;
|
|
|
|
|
- transform: translateY(-64px);
|
|
|
|
|
-
|
|
|
|
|
- &__card {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- max-width: 420px;
|
|
|
|
|
- gap: 14px;
|
|
|
|
|
- padding: 18px;
|
|
|
|
|
- background: #e3efff;
|
|
|
|
|
- border-radius: 12px;
|
|
|
|
|
- color: #6554d9;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &__icon {
|
|
|
|
|
- flex: 0 0 auto;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &__content {
|
|
|
|
|
- min-width: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &__title {
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- line-height: 1.25;
|
|
|
|
|
- margin-bottom: 6px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &__message {
|
|
|
|
|
- line-height: 1.35;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
</style>
|
|
</style>
|