Adding navigation scenarios
This commit is contained in:
parent
ed7882abe9
commit
b16beff2d7
2 changed files with 38 additions and 23 deletions
|
|
@ -43,10 +43,10 @@ export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHerita
|
||||||
return 'vehicle-damage'
|
return 'vehicle-damage'
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.vehicle.vin) {
|
if (store.getters.vehicle.vin) {
|
||||||
return 'heritage';
|
return 'vehicle-damage';
|
||||||
//return "vin-lookup"; (uncomment)
|
//return "vin-lookup"; (uncomment)
|
||||||
} else {
|
} else {
|
||||||
return 'vehicle-damage';
|
return 'license-plate-lookup';
|
||||||
//return "estimate" (uncomment)
|
//return "estimate" (uncomment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
console.log(store.state)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -142,25 +143,39 @@ export default {
|
||||||
this.newServiceZipRequired = true;
|
this.newServiceZipRequired = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const vinLookup = await this.lookupVin(this.licensePlate, zipValidation.data.state).catch(() => {
|
const vinLookup = await this.lookupVin(this.licensePlate, zipValidation.data.state).catch((err) => {
|
||||||
|
console.log(err)
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.vinNotValid = true;
|
this.vinNotValid = true;
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
if (vinLookup.data.vehicle.carId !== store.getters.vehicle.carId) {
|
if (vinLookup.data.vehicle.carId !== store.getters.vehicle.carId && !this.vinDoesNotMatchCarId) {
|
||||||
this.$refs.funnelFooter.updateButtonText(`Continue with ${vinLookup.data.vin} ${vinLookup.data.vehicle.year} ${vinLookup.data.vehicle.make} ${vinLookup.data.vehicle.model}`);
|
this.$refs.funnelFooter.updateButtonText(`Continue with ${vinLookup.data.vin} ${vinLookup.data.vehicle.year} ${vinLookup.data.vehicle.make} ${vinLookup.data.vehicle.model}`);
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.vinDoesNotMatchCarId = true;
|
this.vinDoesNotMatchCarId = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let vin;
|
||||||
|
let carInfo;
|
||||||
|
|
||||||
|
if(this.vinDoesNotMatchCarId) {
|
||||||
|
vin = vinLookup.data.vin;
|
||||||
|
carInfo = vinLookup.data.vehicle;
|
||||||
|
} else {
|
||||||
|
vin = store.getters.vehicle.vin;
|
||||||
|
carInfo = store.getters.vehicle;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateStore(vin, carInfo, zipValidation.data.state);
|
||||||
|
|
||||||
const partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(
|
const partsData = await baseMixin.methods.dispatchNonBlockingStoreAction(
|
||||||
this.storeActions.GET_PARTS_OR_QUESTIONS,
|
this.storeActions.GET_PARTS_OR_QUESTIONS,
|
||||||
{
|
{
|
||||||
carId: store.getters.vehicle.carId,
|
carId: carInfo.carId,
|
||||||
glassArray: store.getters.damage.glassToReplace,
|
glassArray: store.getters.damage.glassToReplace,
|
||||||
zipCode: this.zip,
|
zipCode: this.serviceZip ? this.serviceZip : this.zip,
|
||||||
vin: vinLookup.vin
|
vin: vin
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
@ -190,25 +205,25 @@ export default {
|
||||||
{ licensePlate: plate, licenseState: state }
|
{ licensePlate: plate, licenseState: state }
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
updateStore() {
|
updateStore(vin, carInfo, registrationState) {
|
||||||
// if(vehicleDamage){
|
// if(vehicleDamage){
|
||||||
// store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
// store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
// }
|
// }
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
store.commit(storeMutations.UPDATE_VEHICLE_VIN, vin);
|
||||||
store.commit(storeMutations.UPDATE_YEAR, null);
|
store.commit(storeMutations.UPDATE_YEAR, carInfo.year);
|
||||||
store.commit(storeMutations.UPDATE_MAKE, null);
|
store.commit(storeMutations.UPDATE_MAKE, carInfo.make);
|
||||||
store.commit(storeMutations.UPDATE_MODEL, null);
|
store.commit(storeMutations.UPDATE_MODEL, carInfo.model);
|
||||||
store.commit(storeMutations.UPDATE_STYLE, null);
|
store.commit(storeMutations.UPDATE_STYLE, carInfo.style);
|
||||||
store.commit(storeMutations.UPDATE_CAR_ID, null);
|
store.commit(storeMutations.UPDATE_CAR_ID, carInfo.carId);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null);
|
store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, carInfo.category);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null);
|
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, carInfo.imageUrl);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null);
|
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, carInfo.imageVifNumber);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null);
|
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, carInfo.imageColor);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, null);
|
store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, this.licensePlate);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, null);
|
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, registrationState);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, null);
|
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.zip);
|
||||||
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP, null);
|
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP, this.serviceZip);
|
||||||
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, null);
|
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.email);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue