fix: sidebar & navbar
This commit is contained in:
@@ -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');
|
||||
// };
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -198,12 +209,12 @@
|
||||
data-target="#makeProposalModal"
|
||||
@click="event => $emit('set-load')"
|
||||
>Hacer oferta</button>
|
||||
<button
|
||||
<!-- <button
|
||||
class="btn-primary-sm"
|
||||
@click=""
|
||||
@click="makeCall('+529889662382')"
|
||||
data-toggle="modal"
|
||||
data-target="#proposalsModal"
|
||||
><i class="fa-solid fa-phone clear-sm"></i> Llamar ahora</button>
|
||||
><i class="fa-solid fa-phone clear-sm"></i> Llamar ahora</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user