Relocated mobileLocationLinkPromptId to page level so that service-zip and mobile-location are the same
This commit is contained in:
parent
ebbc522c1c
commit
586be19eb4
2 changed files with 36 additions and 34 deletions
|
|
@ -1,10 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<label
|
|
||||||
for="mobileLocationLinkPromptId"
|
|
||||||
:aria-label="mobileLocationLinkPromptText"
|
|
||||||
class="form-label fw-bold w-100 ps-4 pe-4 pt-4"
|
|
||||||
v-html="mobileLocationLinkPromptText"></label>
|
|
||||||
<div class="update-mobile-location-text-link">
|
<div class="update-mobile-location-text-link">
|
||||||
<textLink
|
<textLink
|
||||||
ref="mobileLocationLink"
|
ref="mobileLocationLink"
|
||||||
|
|
@ -15,10 +10,6 @@
|
||||||
@click-event="openModal"
|
@click-event="openModal"
|
||||||
aria-label="Modal window" />
|
aria-label="Modal window" />
|
||||||
</div>
|
</div>
|
||||||
<textBlock
|
|
||||||
:customText="mobileFeeText"
|
|
||||||
cmsWidgetName="MobileFeeDisclaimerWidget"
|
|
||||||
typeStyle="caption" />
|
|
||||||
</div>
|
</div>
|
||||||
<modal
|
<modal
|
||||||
:ref="modalName"
|
:ref="modalName"
|
||||||
|
|
@ -90,9 +81,6 @@ export default {
|
||||||
alertInvalidZipWidgetName: String,
|
alertInvalidZipWidgetName: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
mobileLocationLinkPromptText() {
|
|
||||||
return this.getCmsContent(this.linkWidgetName, "HeaderText");
|
|
||||||
},
|
|
||||||
mobileLocationLinkText() {
|
mobileLocationLinkText() {
|
||||||
if (
|
if (
|
||||||
this.addressModel.streetAddress !== null &&
|
this.addressModel.streetAddress !== null &&
|
||||||
|
|
@ -111,23 +99,9 @@ export default {
|
||||||
modalHeaderText() {
|
modalHeaderText() {
|
||||||
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
||||||
},
|
},
|
||||||
mobileFeeText() {
|
|
||||||
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
|
|
||||||
return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee);
|
|
||||||
},
|
|
||||||
modalFooterText() {
|
modalFooterText() {
|
||||||
return this.getCmsContent(this.modalWidgetName, "FooterText");
|
return this.getCmsContent(this.modalWidgetName, "FooterText");
|
||||||
},
|
},
|
||||||
mobileFee() {
|
|
||||||
if (!this.modelValue.mobileFeePart) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
this.modelValue.mobileFeePart.laborAmount +
|
|
||||||
this.modelValue.mobileFeePart.sellingPrice +
|
|
||||||
this.modelValue.mobileFeePart.kitPrice
|
|
||||||
);
|
|
||||||
},
|
|
||||||
addressModel: {
|
addressModel: {
|
||||||
get: function () {
|
get: function () {
|
||||||
return this.modelValue.addressQuestions;
|
return this.modelValue.addressQuestions;
|
||||||
|
|
@ -150,7 +124,6 @@ export default {
|
||||||
// Reinitialize the Address Auto Complete
|
// Reinitialize the Address Auto Complete
|
||||||
this.$refs.addressQuestions.setupAddressLookup();
|
this.$refs.addressQuestions.setupAddressLookup();
|
||||||
},
|
},
|
||||||
|
|
||||||
resetModel() {
|
resetModel() {
|
||||||
// Address
|
// Address
|
||||||
this.internalModel.addressQuestions.streetAddress = "";
|
this.internalModel.addressQuestions.streetAddress = "";
|
||||||
|
|
@ -160,7 +133,6 @@ export default {
|
||||||
// Is Vehicle Protected
|
// Is Vehicle Protected
|
||||||
this.internalModel.isVehicleProtected = null;
|
this.internalModel.isVehicleProtected = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
async setMobileLocation() {
|
async setMobileLocation() {
|
||||||
// Validate the Zip Code
|
// Validate the Zip Code
|
||||||
const zipCodeData = await this.getZipCodeData(
|
const zipCodeData = await this.getZipCodeData(
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,21 @@
|
||||||
ref="serviceZipCodeQuestion"
|
ref="serviceZipCodeQuestion"
|
||||||
linkWidgetName="ServiceZipLinkWidget"
|
linkWidgetName="ServiceZipLinkWidget"
|
||||||
modalWidgetName="ServiceZipModalWidget" />
|
modalWidgetName="ServiceZipModalWidget" />
|
||||||
|
<div class="text-center">
|
||||||
|
<label
|
||||||
|
for="mobileLocationLinkPromptId"
|
||||||
|
:aria-label="mobileLocationLinkPromptText"
|
||||||
|
class="form-label fw-bold w-100 ps-4 pe-4 pt-4"
|
||||||
|
v-html="mobileLocationLinkPromptText"></label>
|
||||||
|
</div>
|
||||||
<mobileLocationModalQuestions
|
<mobileLocationModalQuestions
|
||||||
v-model="mobileLocationQuestions"
|
v-model="mobileLocationQuestions"
|
||||||
ref="mobileLocationModalQuestions"
|
ref="mobileLocationModalQuestions"
|
||||||
linkWidgetName="MobileLocationLinkWidget"
|
linkWidgetName="MobileLocationLinkWidget"
|
||||||
modalWidgetName="MobileLocationModalWidget" />
|
modalWidgetName="MobileLocationModalWidget" />
|
||||||
|
<div class="text-center">
|
||||||
|
<textBlock :customText="mobileFeeDisclaimerText" typeStyle="caption" />
|
||||||
|
</div>
|
||||||
<funnel-footer
|
<funnel-footer
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
|
|
@ -39,6 +49,7 @@ import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import { getPricedMobileFeePart } from "@/helpers/service-location-helper";
|
import { getPricedMobileFeePart } from "@/helpers/service-location-helper";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "service-location",
|
name: "service-location",
|
||||||
|
|
@ -112,19 +123,37 @@ export default {
|
||||||
zipCode: this.zipCode,
|
zipCode: this.zipCode,
|
||||||
},
|
},
|
||||||
isVehicleProtected: this.isVehicleProtected,
|
isVehicleProtected: this.isVehicleProtected,
|
||||||
mobileFeePart: this.mobileFeePart
|
mobileFeePart: this.mobileFeePart,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
set: function (newValue) {
|
set: function (newValue) {
|
||||||
this.streetAddress = newValue.addressQuestions.streetAddress;
|
this.streetAddress = newValue.addressQuestions.streetAddress;
|
||||||
this.apartmentNumberOrBusinessName = newValue.addressQuestions.apartmentNumberOrBusinessName,
|
this.apartmentNumberOrBusinessName =
|
||||||
|
newValue.addressQuestions.apartmentNumberOrBusinessName;
|
||||||
this.city = newValue.addressQuestions.city;
|
this.city = newValue.addressQuestions.city;
|
||||||
this.state = newValue.addressQuestions.state;
|
this.state = newValue.addressQuestions.state;
|
||||||
this.zipCode = newValue.addressQuestions.zipCode;
|
this.zipCode = newValue.addressQuestions.zipCode;
|
||||||
this.isVehicleProtected = newValue.isVehicleProtected,
|
this.isVehicleProtected = newValue.isVehicleProtected;
|
||||||
this.mobileFeePart = newValue.mobileFeePart;
|
this.mobileFeePart = newValue.mobileFeePart;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mobileLocationLinkPromptText() {
|
||||||
|
return this.getCmsContent("MobileLocationLinkWidget", "HeaderText");
|
||||||
|
},
|
||||||
|
mobileFeeDisclaimerText() {
|
||||||
|
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
|
||||||
|
return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee);
|
||||||
|
},
|
||||||
|
mobileFee() {
|
||||||
|
if (!this.mobileFeePart) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
this.mobileFeePart.laborAmount +
|
||||||
|
this.mobileFeePart.sellingPrice +
|
||||||
|
this.mobileFeePart.kitPrice
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
@ -157,13 +186,13 @@ export default {
|
||||||
},
|
},
|
||||||
resetMobileFeePart(serviceZipCode) {
|
resetMobileFeePart(serviceZipCode) {
|
||||||
getPricedMobileFeePart(serviceZipCode).then((pricedMobileFeePart) => {
|
getPricedMobileFeePart(serviceZipCode).then((pricedMobileFeePart) => {
|
||||||
this.mobileLocationQuestions.mobileFeePart = pricedMobileFeePart;
|
this.mobileFeePart = pricedMobileFeePart;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
resetMobileLocation(updatedServiceZipCode) {
|
resetMobileLocation(updatedServiceZipCode) {
|
||||||
this.streetAddress = "";
|
this.streetAddress = "";
|
||||||
this.apartmentNumberOrBusinessName = "",
|
this.apartmentNumberOrBusinessName = "";
|
||||||
this.city = "",
|
this.city = "";
|
||||||
this.isVehicleProtected = null;
|
this.isVehicleProtected = null;
|
||||||
|
|
||||||
this.$refs.mobileLocationModalQuestions.resetComponent();
|
this.$refs.mobileLocationModalQuestions.resetComponent();
|
||||||
|
|
@ -185,6 +214,7 @@ export default {
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
Form,
|
Form,
|
||||||
loadingModal,
|
loadingModal,
|
||||||
|
textBlock,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue