fixes: Tracking load & load edit
This commit is contained in:
@@ -107,11 +107,11 @@
|
||||
"phone2" : user.phone2,
|
||||
};
|
||||
let respUser = await updateMyUserProfile( userData );
|
||||
console.log('User create: ', respUser);
|
||||
if(respUser === null) {
|
||||
auth.user = userData;
|
||||
// console.log('User create: ', respUser);
|
||||
if(respUser.msg === 'success') {
|
||||
auth.user = respUser.data;
|
||||
} else {
|
||||
auth.user = respUser;
|
||||
auth.user = userData;
|
||||
}
|
||||
/////// Datos debug ///////
|
||||
notifications.show = true;
|
||||
|
||||
@@ -57,11 +57,11 @@
|
||||
loading.value = true;
|
||||
const result = await auth.updateProfile(userData)
|
||||
loading.value = false;
|
||||
if(result === null) {
|
||||
msgError.value = 'Algo salio mal, intente más tarde';
|
||||
if(result.msg === 'success') {
|
||||
msgSuccess.value = 'Usuario actualizado';
|
||||
clearMessages();
|
||||
} else {
|
||||
msgSuccess.value = 'Usuario actualizado';
|
||||
msgError.value = 'Algo salio mal, intente más tarde';
|
||||
clearMessages();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,15 +35,17 @@
|
||||
const id = route.params['code'];
|
||||
await getLoadTracking(id)
|
||||
if(load.value !== null) {
|
||||
const addressOrigin = load.value.origin_geo?.coordinates;
|
||||
const addressDestination = load.value.destination_geo?.coordinates;
|
||||
if(addressOrigin !== null) {
|
||||
console.log(load.value)
|
||||
const addressOrigin = load.value?.origin_geo?.coordinates;
|
||||
const addressDestination = load.value?.destination_geo?.coordinates;
|
||||
if(addressOrigin && addressDestination) {
|
||||
originCoords.value = {lat: Number.parseFloat(addressOrigin[0]), lng: Number.parseFloat(addressOrigin[1])};
|
||||
destinationCoords.value = {lat: Number.parseFloat(addressDestination[0]), lng: Number.parseFloat(addressDestination[1])};
|
||||
|
||||
polylines.value = await getDirections(originCoords.value, destinationCoords.value);
|
||||
|
||||
}
|
||||
|
||||
if(addressDestination !== null) {
|
||||
destinationCoords.value = {lat: Number.parseFloat(addressDestination[0]), lng: Number.parseFloat(addressDestination[1])};
|
||||
}
|
||||
if(load.value.vehicle) {
|
||||
vehicleLastLocation.value = {
|
||||
lat: parseFloat(load.value.vehicle.last_location_lat),
|
||||
@@ -52,7 +54,6 @@
|
||||
console.log(vehicleLastLocation);
|
||||
}
|
||||
|
||||
polylines.value = await getDirections(originCoords.value, destinationCoords.value);
|
||||
|
||||
console.log(load.value.load_status);
|
||||
switch (load.value.load_status) {
|
||||
@@ -109,8 +110,8 @@
|
||||
fullscreenControl: true
|
||||
}"
|
||||
>
|
||||
<Marker :options="{position: originCoords, label: 'O', title: 'Destino'}" />
|
||||
<Marker :options="{position: destinationCoords, label: 'D', title: 'Origen'}" />
|
||||
<Marker v-if="originCoords" :options="{position: originCoords, label: 'O', title: 'Destino'}" />
|
||||
<Marker v-if="destinationCoords" :options="{position: destinationCoords, label: 'D', title: 'Origen'}" />
|
||||
<CustomMarker
|
||||
v-if="vehicleLastLocation && load.vehicle.background_tracking && isLoadActive"
|
||||
:options="{position: vehicleLastLocation}"
|
||||
|
||||
Reference in New Issue
Block a user