Merge pull request #2529 from Safelite/feature/Digital/CASH-712
CASH-712
This commit is contained in:
commit
672912b1f4
2 changed files with 5 additions and 10 deletions
|
|
@ -236,12 +236,12 @@ export default {
|
||||||
},
|
},
|
||||||
async setMobileLocation() {
|
async setMobileLocation() {
|
||||||
this.resetAlerts();
|
this.resetAlerts();
|
||||||
|
this.setMobileLocationInvalid(true);
|
||||||
// Validate the Zip Code
|
// Validate the Zip Code
|
||||||
if (
|
if (
|
||||||
this.internalModel.addressQuestions.zipCode === "" ||
|
this.internalModel.addressQuestions.zipCode === "" ||
|
||||||
this.internalModel.addressQuestions.zipCode.length !== 5
|
this.internalModel.addressQuestions.zipCode.length !== 5
|
||||||
) {
|
) {
|
||||||
this.setMobileLocationInvalid(true);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const zipCodeData = await this.getZipCodeData(
|
const zipCodeData = await this.getZipCodeData(
|
||||||
|
|
@ -251,11 +251,9 @@ export default {
|
||||||
|
|
||||||
if (!zipCodeData.isValid) {
|
if (!zipCodeData.isValid) {
|
||||||
this.displayInvalidZipAlert = true;
|
this.displayInvalidZipAlert = true;
|
||||||
this.setMobileLocationInvalid(true);
|
|
||||||
return;
|
return;
|
||||||
} else if (zipCodeData.state != this.internalModel.addressQuestions.state) {
|
} else if (zipCodeData.state != this.internalModel.addressQuestions.state) {
|
||||||
this.displayMismatchStateAndZipAlert = true;
|
this.displayMismatchStateAndZipAlert = true;
|
||||||
this.setMobileLocationInvalid(true);
|
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
this.internalModel.addressQuestions.zipCode !==
|
this.internalModel.addressQuestions.zipCode !==
|
||||||
|
|
@ -295,7 +293,6 @@ export default {
|
||||||
}
|
}
|
||||||
// update the page level model
|
// update the page level model
|
||||||
this.$emit("setMobileLocation", this.internalModel);
|
this.$emit("setMobileLocation", this.internalModel);
|
||||||
this.setMobileLocationInvalid(false);
|
|
||||||
},
|
},
|
||||||
toggleMobileLocation() {
|
toggleMobileLocation() {
|
||||||
this.isMobileLocationOpened = !this.isMobileLocationOpened;
|
this.isMobileLocationOpened = !this.isMobileLocationOpened;
|
||||||
|
|
|
||||||
|
|
@ -526,6 +526,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (this.isServiceableMobile) {
|
if (this.isServiceableMobile) {
|
||||||
this.setMobileLocation(newValue);
|
this.setMobileLocation(newValue);
|
||||||
|
this.setMobileLocationInValid(false);
|
||||||
} else {
|
} else {
|
||||||
await getZipCodeData(newZipCode).then((zipCodeData) => {
|
await getZipCodeData(newZipCode).then((zipCodeData) => {
|
||||||
this.serviceZipCodeQuestion = {
|
this.serviceZipCodeQuestion = {
|
||||||
|
|
@ -754,13 +755,13 @@ export default {
|
||||||
setMobileLocationInValid(isMobileLocationInValid) {
|
setMobileLocationInValid(isMobileLocationInValid) {
|
||||||
this.isMobileAddressValid = !isMobileLocationInValid;
|
this.isMobileAddressValid = !isMobileLocationInValid;
|
||||||
},
|
},
|
||||||
displayMobileAddressQuestion(openMobileLocation) {
|
displayMobileAddressQuestion() {
|
||||||
var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions;
|
var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions;
|
||||||
var isMobileAddressComplete = mobileLocationQuestionsRef?.isMobileAddressComplete;
|
var isMobileAddressComplete = mobileLocationQuestionsRef?.isMobileAddressComplete;
|
||||||
if (isMobileAddressComplete?.()) {
|
if (isMobileAddressComplete?.()) {
|
||||||
mobileLocationQuestionsRef.isMobileLocationOpened = false;
|
mobileLocationQuestionsRef.isMobileLocationOpened = false;
|
||||||
} else {
|
} else {
|
||||||
mobileLocationQuestionsRef.isMobileLocationOpened = openMobileLocation;
|
mobileLocationQuestionsRef.isMobileLocationOpened = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getIsMobileLocationOpened() {
|
getIsMobileLocationOpened() {
|
||||||
|
|
@ -777,10 +778,8 @@ export default {
|
||||||
this.selectedProvider = new Provider(
|
this.selectedProvider = new Provider(
|
||||||
this.shopProviderData.mobileProviderNumber
|
this.shopProviderData.mobileProviderNumber
|
||||||
);
|
);
|
||||||
this.displayMobileAddressQuestion(true);
|
|
||||||
} else {
|
} else {
|
||||||
this.selectedProvider = new Provider();
|
this.selectedProvider = new Provider();
|
||||||
this.displayMobileAddressQuestion(false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -792,10 +791,9 @@ export default {
|
||||||
this.selectedProvider = new Provider(
|
this.selectedProvider = new Provider(
|
||||||
this.shopProviderData.mobileProviderNumber
|
this.shopProviderData.mobileProviderNumber
|
||||||
);
|
);
|
||||||
this.displayMobileAddressQuestion(true);
|
this.displayMobileAddressQuestion();
|
||||||
} else {
|
} else {
|
||||||
this.selectedProvider = new Provider();
|
this.selectedProvider = new Provider();
|
||||||
this.displayMobileAddressQuestion(false);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue