From dd674b053bce4af1485667e285a99afd335e804f Mon Sep 17 00:00:00 2001 From: Alexandro Uc Santos Date: Sat, 25 Nov 2023 19:52:45 -0600 Subject: [PATCH] add: completed register view --- src/assets/main.css | 25 +- src/components/ui/Cities.vue | 60 ++++ src/components/ui/CustomInput.vue | 6 + src/components/ui/CustomRadioInput.vue | 101 +++++++ src/components/ui/Segments.vue | 61 ++++ src/components/ui/States.vue | 63 +++++ src/components/ui/TruckTypes.vue | 64 +++++ src/helpers/validations.js | 11 + src/layouts/AuthLayout.vue | 44 +-- src/services/public.js | 2 + src/stores/auth.js | 31 ++- src/views/CompleteRegisterView.vue | 369 +++++++++++++++++++------ src/views/LoginView.vue | 6 +- 13 files changed, 712 insertions(+), 131 deletions(-) create mode 100644 src/components/ui/Cities.vue create mode 100644 src/components/ui/CustomRadioInput.vue create mode 100644 src/components/ui/Segments.vue create mode 100644 src/components/ui/States.vue create mode 100644 src/components/ui/TruckTypes.vue diff --git a/src/assets/main.css b/src/assets/main.css index f315452..63ec290 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -7,6 +7,10 @@ body { width: 45%; } +.bg-body { + background-color: #fdfcfc !important; +} + .radius-1 { border-radius: 1rem !important; } @@ -43,7 +47,7 @@ body { color: #FFF; padding: 12px 30px; border: none; - border-radius: 25px; + border-radius: 13px; font-size: 18px; text-decoration: none; font-weight: 900; @@ -94,14 +98,15 @@ body { border: none; border-radius: 13px; display: flex; - filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.10)); margin-bottom: 12px; + filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.10)); } .card-info h2{ - font-size: 1.5rem; - font-weight: 800; + font-size: 1.4rem; + font-weight: 700; color: #323030; + margin-bottom: 1rem; } .card-info p{ @@ -141,6 +146,16 @@ td { font-size: 1rem; } +.custom-input-light { + background-color: transparent; + border-radius: 8px; + border-width: 1px !important; + border-color: rgb(226, 214, 214) !important; + border-style: solid !important; + padding: 10px 12px; + font-size: 1rem; +} + .custom-input:enabled{ border: none; } @@ -185,7 +200,7 @@ td { .btn-primary-lg { padding: 8px 15px; border: none; - border-radius: 25px; + border-radius: 13px; font-size: 16px; font-weight: 700; } diff --git a/src/components/ui/Cities.vue b/src/components/ui/Cities.vue new file mode 100644 index 0000000..5f96e65 --- /dev/null +++ b/src/components/ui/Cities.vue @@ -0,0 +1,60 @@ + + + + + + + \ No newline at end of file diff --git a/src/components/ui/CustomInput.vue b/src/components/ui/CustomInput.vue index 406fef9..c46d273 100644 --- a/src/components/ui/CustomInput.vue +++ b/src/components/ui/CustomInput.vue @@ -7,6 +7,11 @@ type: String, required: false, }, + filled: { + type: Boolean, + required: false, + default: true, + }, name: { type: String, required: true, @@ -29,6 +34,7 @@ + defineProps({ + typeselected: { + type: String + }, + checked: { + type: Boolean + }, + value: { + type: String + }, + label: { + type: String, + required: false, + }, + name: { + type: String, + required: true, + } + }) + + defineEmits(['update:typeselected']) + + + + + \ No newline at end of file diff --git a/src/components/ui/Segments.vue b/src/components/ui/Segments.vue new file mode 100644 index 0000000..dc5c7c3 --- /dev/null +++ b/src/components/ui/Segments.vue @@ -0,0 +1,61 @@ + + + + + + + \ No newline at end of file diff --git a/src/components/ui/States.vue b/src/components/ui/States.vue new file mode 100644 index 0000000..9e42fde --- /dev/null +++ b/src/components/ui/States.vue @@ -0,0 +1,63 @@ + + + + + + + \ No newline at end of file diff --git a/src/components/ui/TruckTypes.vue b/src/components/ui/TruckTypes.vue new file mode 100644 index 0000000..0ec56ff --- /dev/null +++ b/src/components/ui/TruckTypes.vue @@ -0,0 +1,64 @@ + + + + + + + \ No newline at end of file diff --git a/src/helpers/validations.js b/src/helpers/validations.js index 02bd606..a6e4ea1 100644 --- a/src/helpers/validations.js +++ b/src/helpers/validations.js @@ -6,6 +6,17 @@ export const validateEmail = (email) => { ); }; +export const validRFC = (rfc, type) => { + + const size = type === 'fisica' ? 13 : 12; + + if( rfc.trim().length !== size ) { + return false; + } else { + return true; + } +} + export const messagesError = (msg) => { switch (msg) { case 'Invalid credentials': diff --git a/src/layouts/AuthLayout.vue b/src/layouts/AuthLayout.vue index 2978a77..47bd53d 100644 --- a/src/layouts/AuthLayout.vue +++ b/src/layouts/AuthLayout.vue @@ -8,13 +8,7 @@ @@ -34,35 +28,23 @@ justify-content: center; align-items: center; align-content: center; - width: 50%; + /* background-color: red; */ + width: 55%; margin: 0px auto !important; - padding: 0px 0px !important; + padding: 0px 5px !important; overflow: hidden; min-height: 700px; } - .img-auth { - width: 50%; - /* object-fit: cover; */ - margin: 24px 50px; - /* padding: 24p */ - } - - .img { - width: 100%; - /* max-height: 80vh; */ - border-radius: 13px; - /* object-fit: cover; */ - /* padding: 24px; */ + + @media (max-width: 1024px) { + .auth-layout { + width: 70%; + } } - .auth-view { - display: flex; - width: 50%; - margin: 0px 0px; - padding: 0px 0px; - /* background-color: red; */ - flex-direction: column; - align-items: center; - justify-content: center; + @media (max-width: 768px) { + .auth-layout { + width: 90%; + } } \ No newline at end of file diff --git a/src/services/public.js b/src/services/public.js index 8d6f66a..683fbe0 100644 --- a/src/services/public.js +++ b/src/services/public.js @@ -1,3 +1,5 @@ +import api from "../lib/axios"; + export const getLoadDirectories = async(filterStr) => { try { const endpoint = `/public-loads${filterStr}`; diff --git a/src/stores/auth.js b/src/stores/auth.js index 296687b..40a27eb 100644 --- a/src/stores/auth.js +++ b/src/stores/auth.js @@ -19,20 +19,23 @@ export const useAuthStore = defineStore('auth', () => { }); const checkSession = async() => { - checking.value = true; - const resp = await renewToken(); - if(resp.msg === 'success') { - localStorage.setItem('session', resp.data.session_token); - sesion.value = resp.data.session_token; - token.value = resp.data.accessToken; - user.value = resp.data.user; - checking.value = false; - } else { - noty.show = true; - noty.text = 'Sesión ha expirado, ingresa nuevamente'; - noty.error = true; - checking.value = false; - router.push({name: 'login'}); + const session = localStorage.getItem('session'); + if(session) { + checking.value = true; + const resp = await renewToken(); + if(resp.msg === 'success') { + localStorage.setItem('session', resp.data.session_token); + sesion.value = resp.data.session_token; + token.value = resp.data.accessToken; + user.value = resp.data.user; + checking.value = false; + } else { + noty.show = true; + noty.text = 'Sesión ha expirado, ingresa nuevamente'; + noty.error = true; + checking.value = false; + router.push({name: 'login'}); + } } } diff --git a/src/views/CompleteRegisterView.vue b/src/views/CompleteRegisterView.vue index 658acea..9356882 100644 --- a/src/views/CompleteRegisterView.vue +++ b/src/views/CompleteRegisterView.vue @@ -1,94 +1,307 @@ diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 3dced71..6e3ec39 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -10,8 +10,8 @@ const form = reactive({ - email: 'alexandro.uc.santos@gmail.com', - password: 'Password0', + email: 'julio_alex@etaviaporte.com', + password: 'Password1', }); const router = useRouter(); @@ -80,7 +80,7 @@