all coverage content displaying correctly

This commit is contained in:
Katie Kroell 2023-07-14 12:05:40 -04:00
parent e25a37ef41
commit 89ace9c7f2

View file

@ -24,21 +24,25 @@
v-if="verifiedDeductible"
class="d-flex justify-content-center cost">
{{ formattedDeductible }}
</div>
<div
v-if="displayQuote"
class="d-flex justify-content-center cost" >
class="d-flex justify-content-center cost mb-1">
{{ formattedServicePrice }}
</div>
<div
v-if="verifiedITAC">Your deductible is:
{{ formattedDeductible }}
</div>
v-if="verifiedITAC"
class="d-flex justify-content-center mb-4">
{{ deductibleText }}
<span class="text-success fw-bold">{{ formattedDeductible }}</span>
</div>
<alert
ref="verifiedITACAlert"
v-if="verifiedITAC"
class="mb-4"
cmsWidgetName="VerifiedITACAlert"
:manualHeadline="verifiedITACAlertHeader"
:manualCopy="verifiedITACAlertBody"
alertClass="alert-success"
v-bind:isDismissible="false">
</alert>
@ -77,7 +81,7 @@
</div>
</div>
<recalModal ref="RecalModal" cmsWidgetName="RecalModal" />
<contentGroupModal ref="DeductibleModal" cmsWidgetName="DeductibleModal" />
<contentGroupModal ref="DeductibleModal" cmsWidgetName="DeductibleModal" class="deductible-modal"/>
</Form>
</template>
<script>
@ -176,8 +180,7 @@ export default {
},
data() {
return {
//isVerified: store.order.payment.insuranceCoverage.isVerified,
//isVerified: true,
isVerified: true, // once verification is complete, change to store.order.payment.insuranceCoverage.isVerified
supportingItems: [],
pricedGlassParts: [],
availableLineItems: [],
@ -185,6 +188,18 @@ export default {
}
},
computed: {
verifiedITACAlertHeader() {
return this.getCmsContent(
"VerifiedITACAlert",
"HeadlineText"
)
},
verifiedITACAlertBody() {
return this.getCmsContent(
"VerifiedITACAlert",
"BodyText"
).replaceAll("{custom:costSavings}", this.costSavings);
},
coverageStatementSubHeader() {
const subheader = this.getSubheaderTextFromCms("SiteSubHeaderWidget");
return subheader;
@ -205,119 +220,121 @@ export default {
let body = this.getBodyTextFromCms("NextStepsWidget").replaceAll("{custom:damage}", this.damageText);
return body;
},
continueWithSchedulingBodyText() {
return this.getCmsContent("continueWithSchedulingCopy", "BodyText");
},
unverifiedADASNextStepsBodyText() {
return this.getCmsContent("UnverifiedADASNextStepsWidget", "BodyText").replaceAll("{custom:damage}", this.damageText);
},
unverifiedNonADASNextStepsBodyText() {
return this.getCmsContent("UnverifiedNonADASNextStepsWidget", "BodyText").replaceAll("{custom:damage}", this.damageText);
},
unverifiedNonADASRepairBodyText() {
return this.getCmsContent("UnverifiedNonADASRepairWidget", "BodyText");
},
damageText() {
var damageString = getDamageString();
return damageString == "match" ? "" : damageString;
},
vehicleDeductible() {
if (this.coverageVerified) {
if (store.order.damage.isRepair) {
const repairDeductible = store.order.policy.deductible.repair
return repairDeductible;
}
else {
const replaceDeductible = store.order.policy.deductible.replace;
return replaceDeductible;
}
}
},
formattedDeductible() {
return this.getDeductibleString(this.vehicleDeductible);
},
isDeductibleZero() {
if (this.coverageVerified && !this.verifiedNoComp) {
return this.vehicleDeductible === 0;
}
},
deductibleOverZero() {
if (this.coverageVerified && !this.verifiedNoComp) {
return !this.isDeductibleZero;
}
},
coverageVerified() {
return true;
//return this.isVerified;
},
coverageUnverified() {
return false;
//return !this.isVerified;
},
verifiedNoComp() {
if (this.coverageVerified) {
return store.order.policy.noCompensation;
}
},
verifiedITAC() {
if (this.coverageVerified && !this.verifiedNoComp) {
if (this.vehicleDeductible > this.totalServicePrice) {
return true;
}
}
},
verifiedDeductible() {
if (this.coverageVerified && !this.verifiedNoComp) {
if (this.totalServicePrice > this.vehicleDeductible) {
return true;
}
}
},
ADASReplace() {
if (!store.order.damage.isRepair) {
let parts = store.order.lineItems.glassParts;
if (parts != null && parts.filter(part => part.requiresRecalibration).length > 0) {
return true;
}
}
},
nonADASReplace() {
if (!store.order.damage.isRepair) {
return !this.ADASReplace;
}
},
nonADASRepair() {
continueWithSchedulingBodyText() {
return this.getCmsContent("continueWithSchedulingCopy", "BodyText");
},
unverifiedADASNextStepsBodyText() {
return this.getCmsContent("UnverifiedADASNextStepsWidget", "BodyText").replaceAll("{custom:damage}", this.damageText);
},
unverifiedNonADASNextStepsBodyText() {
return this.getCmsContent("UnverifiedNonADASNextStepsWidget", "BodyText").replaceAll("{custom:damage}", this.damageText);
},
unverifiedNonADASRepairBodyText() {
return this.getCmsContent("UnverifiedNonADASRepairWidget", "BodyText");
},
damageText() {
var damageString = getDamageString();
return damageString == "match" ? "" : damageString;
},
vehicleDeductible() {
if (this.coverageVerified) {
if (store.order.damage.isRepair) {
return true;
const repairDeductible = store.order.policy.deductible.repair
return repairDeductible;
}
},
totalServicePrice() {
let total = 0;
this.availableLineItems.forEach((lineItem) => {
total += this.getTotalLineItemPrice(lineItem);
})
return total;
},
formattedServicePrice() {
return this.getServicePriceString(this.totalServicePrice);
},
costSavings() {
return this.getITACCostSavings(this.vehicleDeductible, this.totalServicePrice);
},
questionText() {
return this.getCmsContent("ServiceProviderQuestion", "QuestionText");
},
answersFromCms() {
return this.getCmsContent("ServiceProviderQuestion", "Answers");
},
displayQuote() {
if (this.verifiedITAC || this.verifiedNoComp) {
else {
const replaceDeductible = store.order.policy.deductible.replace;
return replaceDeductible;
}
}
},
formattedDeductible() {
return this.getDeductibleString(this.vehicleDeductible);
},
isDeductibleZero() {
if (this.coverageVerified && this.verifiedDeductible) {
return this.vehicleDeductible === 0;
}
},
deductibleOverZero() {
if (this.coverageVerified && this.verifiedDeductible) {
return !this.isDeductibleZero;
}
},
coverageVerified() {
return this.isVerified;
},
coverageUnverified() {
return !this.isVerified;
},
verifiedNoComp() {
if (this.coverageVerified) {
return store.order.policy.noCompensation;
}
},
verifiedITAC() {
if (this.coverageVerified && !this.verifiedNoComp) {
if (this.vehicleDeductible > this.totalServicePrice) {
return true;
}
}
},
},
verifiedDeductible() {
if (this.coverageVerified && !this.verifiedNoComp) {
if (this.totalServicePrice > this.vehicleDeductible) {
return true;
}
}
},
ADASReplace() {
if (!store.order.damage.isRepair) {
let parts = store.order.lineItems.glassParts;
if (parts != null && parts.filter(part => part.requiresRecalibration).length > 0) {
return true;
}
}
},
nonADASReplace() {
if (!store.order.damage.isRepair) {
return !this.ADASReplace;
}
},
nonADASRepair() {
if (store.order.damage.isRepair) {
return true;
}
},
totalServicePrice() {
let total = 0;
this.availableLineItems.forEach((lineItem) => {
total += this.getTotalLineItemPrice(lineItem);
})
return total;
},
formattedServicePrice() {
return this.getServicePriceString(this.totalServicePrice);
},
costSavings() {
const savings = this.getITACCostSavings(this.vehicleDeductible, this.totalServicePrice);
const formattedSavings = parseFloat(savings).toFixed(2);
return '$' + formattedSavings;
},
questionText() {
return this.getCmsContent("ServiceProviderQuestion", "QuestionText");
},
answersFromCms() {
return this.getCmsContent("ServiceProviderQuestion", "Answers");
},
displayQuote() {
if (this.verifiedITAC || this.verifiedNoComp) {
return true;
}
},
deductibleText() {
return "Your deductible is:";
}
},
methods: {
arePagePrerequisitesValid() {
if (useMainStore().vehicle.vin) {
@ -359,6 +376,7 @@ export default {
},
processIfStatements,
getHeaderTextFromCms(cmsWidgetName) {
console.log(this.coverageUnverified);
const header = this.getCmsContent(cmsWidgetName, 'HeaderText');
return this.processIfStatements(header, "custom", this.getCustomValueFromString);
},
@ -458,4 +476,23 @@ export default {
}
}
.deductible-modal {
p {
margin-bottom: 0px;
}
.modal-body p:last-child {
font-size: 16px;
line-height: 26px;
}
.my-4 {
margin-top: 8px !important;
margin-bottom: 0px !important;
}
img.mb-4 {
margin: 0 !important;
}
}
</style>