CASH-273: Update service location when mobile service zip doesn't offer mobile service
This commit is contained in:
parent
29815f7022
commit
a2be43e190
2 changed files with 32 additions and 13 deletions
|
|
@ -6,7 +6,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const zipCodeData = await baseMixin.methods.getZipCodeData(serviceZipCode, pageNameToLog);
|
const zipCodeData = await getZipCodeData(serviceZipCode);
|
||||||
|
|
||||||
// Get the Mobile Fee Part
|
// Get the Mobile Fee Part
|
||||||
const mobileFeePart = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const mobileFeePart = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
|
@ -103,3 +103,7 @@ export async function getAvailabilityRating(
|
||||||
|
|
||||||
return shopStatus;
|
return shopStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getZipCodeData(serviceZipCode) {
|
||||||
|
return await baseMixin.methods.getZipCodeData(serviceZipCode, "service-location");
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ import {
|
||||||
getPricedMobileFeePart,
|
getPricedMobileFeePart,
|
||||||
getServiceabilityDetails,
|
getServiceabilityDetails,
|
||||||
getShopProviderData,
|
getShopProviderData,
|
||||||
|
getZipCodeData,
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import { applicationConfig } from "@/constants/application-config";
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
|
|
@ -206,10 +207,7 @@ export default {
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
|
|
||||||
const serviceZipCode = store.getters.order.serviceLocation.zipCode;
|
const serviceZipCode = store.getters.order.serviceLocation.zipCode;
|
||||||
const zipCodeDataPromise = baseMixin.methods.getZipCodeData(
|
const zipCodeDataPromise = getZipCodeData(serviceZipCode);
|
||||||
serviceZipCode,
|
|
||||||
"service-location"
|
|
||||||
);
|
|
||||||
|
|
||||||
const serviceabilityDetailsPromise = getServiceabilityDetails(
|
const serviceabilityDetailsPromise = getServiceabilityDetails(
|
||||||
serviceZipCode,
|
serviceZipCode,
|
||||||
|
|
@ -475,17 +473,31 @@ export default {
|
||||||
},
|
},
|
||||||
//creating async function as the computed property can not directly handle asynchronous operations or promises.
|
//creating async function as the computed property can not directly handle asynchronous operations or promises.
|
||||||
async setMobileLocationQuestions(newValue) {
|
async setMobileLocationQuestions(newValue) {
|
||||||
|
var newZipCode = newValue.addressQuestions.zipCode;
|
||||||
if (newValue.addressQuestions.zipCode !== this.zipCode) {
|
if (newValue.addressQuestions.zipCode !== this.zipCode) {
|
||||||
await getShopProviderData(newValue.addressQuestions.zipCode).then((result) => {
|
await getShopProviderData(newZipCode).then((result) => {
|
||||||
|
if (this.isServiceableMobile) {
|
||||||
this.shopProviderData = result.data;
|
this.shopProviderData = result.data;
|
||||||
this.selectedProvider = new Provider(
|
this.selectedProvider = new Provider(
|
||||||
this.shopProviderData.mobileProviderNumber
|
this.shopProviderData.mobileProviderNumber
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (this.isServiceableMobile) {
|
||||||
this.setMobileLocation(newValue);
|
this.setMobileLocation(newValue);
|
||||||
//proceed to next page
|
//proceed to next page
|
||||||
this.forwardButtonAction();
|
this.forwardButtonAction();
|
||||||
|
} else {
|
||||||
|
this.closeModalAction("mobileLocationQuestions");
|
||||||
|
await getZipCodeData(newZipCode).then((zipCodeData) => {
|
||||||
|
this.serviceZipCodeQuestion = {
|
||||||
|
state: zipCodeData.state,
|
||||||
|
zipCode: newZipCode,
|
||||||
|
zipCodeCtu: zipCodeData.zipCodeCtu,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getServiceAddressFromStore() {
|
getServiceAddressFromStore() {
|
||||||
return store.getters.order.serviceLocation.address;
|
return store.getters.order.serviceLocation.address;
|
||||||
|
|
@ -669,6 +681,9 @@ export default {
|
||||||
openModalAction(modalName) {
|
openModalAction(modalName) {
|
||||||
this.$refs[modalName].openModal();
|
this.$refs[modalName].openModal();
|
||||||
},
|
},
|
||||||
|
closeModalAction(modalName) {
|
||||||
|
this.$refs[modalName].closeModal();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
zipCode: {
|
zipCode: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue