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