79 lines
2.5 KiB
Vue
79 lines
2.5 KiB
Vue
<script setup>
|
|
import AuthLayout from '../../layouts/AuthLayout.vue'
|
|
import UiButton from '../../components/ui/UiButton.vue'
|
|
import UiInput from '../../components/ui/UiInput.vue'
|
|
import { Link } from '@inertiajs/inertia-vue3';
|
|
import { Inertia } from '@inertiajs/inertia'
|
|
import { ref } from 'vue';
|
|
import { inject } from 'vue';
|
|
import { toast } from 'vue3-toastify';
|
|
|
|
const route = inject('route');
|
|
|
|
const code = ref('');
|
|
const isLoading = ref(false);
|
|
|
|
const handleVerifyOtp = () => {
|
|
isLoading.value = true
|
|
Inertia.post(route('verifyOtp'), {
|
|
otp_code: code.value
|
|
}, {
|
|
onError: (errors) => {
|
|
toast.error(errors.otp_code || 'خطا در تایید کد تایید', {
|
|
position: 'top-right',
|
|
rtl: true,
|
|
theme: 'colored',
|
|
autoClose: 3000,
|
|
})
|
|
},
|
|
onFinish: () => {
|
|
isLoading.value = false
|
|
}
|
|
})
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<AuthLayout>
|
|
<main class="p-9 h-auto w-[450px] max-sm:w-[90%] m-auto bg-white rounded-xl">
|
|
<div class="grid grid-cols-a justify-start">
|
|
<h1 class="text-[16px] font-semibold !text-dominant-800">
|
|
{{ $t('auth.OtpVerification.title').replace('%userType%', 'پزشکان') }}
|
|
</h1>
|
|
<p class="!text-dominant-800 mt-1 text-[11px] font-normal">
|
|
{{ $t('auth.OtpVerification.subtitle') }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-2 mt-6">
|
|
<UiInput
|
|
prefix-end="کد تایید موقت"
|
|
type="text"
|
|
custom-class="!pl-3"
|
|
direction="ltr"
|
|
v-model="code"
|
|
/>
|
|
<UiButton
|
|
severity="dominant"
|
|
class="!mt-4"
|
|
:label="isLoading ? 'در حال تایید...' : 'تایید و بازیابی گذرواژه'"
|
|
size="large"
|
|
full-width
|
|
outlined
|
|
height="40px"
|
|
icon-position="start"
|
|
icon-class="!text-sm mt-1"
|
|
:loading="isLoading"
|
|
@click="handleVerifyOtp"
|
|
/>
|
|
</div>
|
|
</main>
|
|
<template #footer>
|
|
<Link class="text-center text-[13px] font-normal text-dominant-700 mt-6" :href="route('login')">
|
|
تغییر شماره موبایل
|
|
</Link>
|
|
</template>
|
|
</AuthLayout>
|
|
</template>
|