From 1027f38eb084c596936d691b597f62694ea65b58 Mon Sep 17 00:00:00 2001 From: Alexandro Uc Santos Date: Fri, 10 May 2024 19:59:40 -0600 Subject: [PATCH] fix: sidebar & navbar --- src/components/CardLoad.vue | 17 ++++++++++++++--- src/components/LoadDetailModal.vue | 21 ++++++++++++++++----- src/components/NavBar.vue | 3 ++- src/layouts/AdminLayout.vue | 7 +++++-- src/router/index.js | 2 +- src/services/company.js | 2 +- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/components/CardLoad.vue b/src/components/CardLoad.vue index faf43c3..d864778 100644 --- a/src/components/CardLoad.vue +++ b/src/components/CardLoad.vue @@ -23,6 +23,8 @@ } }); + console.log(props.load) + defineEmits(['set-load']) @@ -93,6 +95,15 @@ // }) } + // const makeCall = (phoneNumber) => { + // console.log(phoneNumber) + // // Formatear el número de teléfono eliminando espacios y caracteres especiales + // // const formattedPhoneNumber = phoneNumber.value.replace(/[^0-9]/g, ''); + + // // Abrir la aplicación de llamadas telefónicas con el número especificado + // window.open(`tel:${phoneNumber}`, '_self'); + // }; + diff --git a/src/components/LoadDetailModal.vue b/src/components/LoadDetailModal.vue index 1ad96ec..876200d 100644 --- a/src/components/LoadDetailModal.vue +++ b/src/components/LoadDetailModal.vue @@ -21,7 +21,7 @@ import { useNotificationsStore } from '../stores/notifications'; const vehicleLastLocation = ref(null); const isLoadActive = ref(false); - const { getDirections } = useDirectionsRender() + const { getDirections, geocodeAddress } = useDirectionsRender() const props = defineProps({ proposal: { @@ -46,20 +46,31 @@ import { useNotificationsStore } from '../stores/notifications'; }); const initData = async() => { - console.log(props.proposal) isLoading.value = true; const code = props.proposal.load.shipment_code; const filter = "?shipment_code[$in]=" + code; const resp = await loadStore.getLoad(filter); - console.log(resp); if(resp.total > 0) { load.value = resp.data[0]; try { const addressOrigin = load.value?.origin; const addressDestination = load.value?.destination; if(addressOrigin && addressDestination) { - originCoords.value = {lat: Number.parseFloat(addressOrigin.lat), lng: Number.parseFloat(addressOrigin.lng)}; - destinationCoords.value = {lat: Number.parseFloat(addressDestination.lat), lng: Number.parseFloat(addressDestination.lng)}; + if(addressOrigin.lat && addressOrigin.lng) { + originCoords.value = {lat: Number.parseFloat(addressOrigin.lat), lng: Number.parseFloat(addressOrigin.lng)}; + } else { + console.log('No hay coords origin') + let startLocation = addressOrigin.street_address1 + ', ' + addressOrigin.city + ', ' + addressOrigin.state + ', ' + addressOrigin.country + ', ' +addressOrigin.zipcode; + originCoords.value = await geocodeAddress(startLocation); + } + + if(addressDestination.lat && addressDestination.lng) { + destinationCoords.value = {lat: Number.parseFloat(addressDestination.lat), lng: Number.parseFloat(addressDestination.lng)}; + } else { + console.log('No hay coords destinatiom') + let endLocation = addressDestination.street_address1 + ', ' + addressDestination.city + ', ' + addressDestination.state + ', ' + addressDestination.country + ', ' +addressDestination.zipcode; + destinationCoords.value = await geocodeAddress(endLocation); + } polylines.value = await getDirections(originCoords.value, destinationCoords.value); diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index bb38ab8..358c674 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -52,7 +52,7 @@ import { useNotificationsStore } from '../stores/notifications'; .custom-navbar { display: block; - width: calc(100vw - 220px); + width: calc(100vw - 236px); background-color: #FFF; padding: 16px 0px; } @@ -114,6 +114,7 @@ import { useNotificationsStore } from '../stores/notifications'; justify-content: space-between; } .btn-menu { + margin-left: 8px; display: flex; } } diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index 5f439ff..bfc72ab 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -34,12 +34,14 @@ .main-panel { position: relative; margin-left: 220px; - width: calc(100wv - 220px) !important; + // width: calc(100wv - 220px) !important; + width: calc(100% - 220px); //new } .view { width: 100%; padding: 24px 50px; + background-color: #f6f3f3; } @media (max-width: 1400px) { @@ -52,7 +54,8 @@ .main-panel { position: relative; margin-left: 0px; - width: 100wv !important; + // width: 100wv !important; + width: 100%; //new } .view { margin: 24px 0px; diff --git a/src/router/index.js b/src/router/index.js index c481ba3..2819c82 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -46,7 +46,7 @@ const router = createRouter({ component: () => import('../views/TermsAndConditionsView.vue') }, { - path: 'eviso-de-privacidad', + path: 'aviso-de-privacidad', name: 'notice-privacy', component: () => import('../views/NoticeOfPrivacyView.vue') }, diff --git a/src/services/company.js b/src/services/company.js index 2d23903..9d816fe 100644 --- a/src/services/company.js +++ b/src/services/company.js @@ -86,7 +86,7 @@ export const deleteUser = async(user_id) => { export const getBudgets = async(filter) => { try { - const endpoint = `/budgets/${filter}`; + const endpoint = `v1/budgets/${filter}`; const {data} = await api.get(endpoint); // console.log(data); return data;