commit
048ddd295c
1 changed files with 19 additions and 10 deletions
|
|
@ -203,10 +203,13 @@ export default {
|
|||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
|
||||
);
|
||||
},
|
||||
zip() {
|
||||
this.noServiceZip = false;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
perfectMatchNewVinAlert() {
|
||||
const isVinPerfectMatch = this.vinPopulatedOnPageLoad && this.vin === this.getVinFromStore();
|
||||
const isVinPerfectMatch = this.vinPopulatedOnPageLoad && this.initialVin === this.getVinFromStore();
|
||||
this.updateIsCarIdDifferent(isVinPerfectMatch);
|
||||
return isVinPerfectMatch;
|
||||
},
|
||||
|
|
@ -309,33 +312,39 @@ export default {
|
|||
const zipValidation = this.validateZip(this.zip);
|
||||
const zipValidationResponse = await zipValidation;
|
||||
|
||||
// Check if Service Zip entered is servicable, if not display an alert
|
||||
if (!zipValidationResponse.data.isServiceable) {
|
||||
this.customAlertData.zip = this.zip;
|
||||
this.$refs.funnelFooter.removeLoader();
|
||||
this.customAlertData.zip = this.zip;
|
||||
this.noServiceZip = true;
|
||||
this.invalidZip = this.zip;
|
||||
return;
|
||||
}
|
||||
|
||||
// If the user has clicked on the VIN field, either they are doing a new VIN lookup or changing the VIN previously matched.
|
||||
// Therefore we need to do a VIN Lookup
|
||||
let vehicleLookupResponse;
|
||||
if (this.vinTouched && this.vin != this.initialVin) {
|
||||
// If the user has clicked on the VIN field, either they are doing a new VIN lookup or changing the VIN previously matched.
|
||||
// Therefore we need to do a VIN Lookup
|
||||
const vinToLookup = this.vinTouched ? this.vin : this.initialVin;
|
||||
const vehicleLookup = this.lookupVehicle(vinToLookup);
|
||||
vehicleLookupResponse = await vehicleLookup.catch((response) => {
|
||||
if (response.status == StatusCodes.NOT_FOUND) {
|
||||
this.vinNotFound = true;
|
||||
this.$refs.funnelFooter.removeLoader();
|
||||
this.noServiceZip = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (!vehicleLookupResponse) {
|
||||
return;
|
||||
}
|
||||
// if the ZIP is not serviceable or the Vin Lookup didn't return anything then don't complete the process and navigate forward.
|
||||
if (!zipValidationResponse.data.isServiceable || !vehicleLookupResponse) {
|
||||
this.$refs.funnelFooter.removeLoader();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// if the ZIP is not serviceable then don't navigate forward.
|
||||
if (!zipValidationResponse.data.isServiceable) {
|
||||
this.$refs.funnelFooter.removeLoader();
|
||||
return;
|
||||
}
|
||||
|
||||
this.navigateForward();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue