coverage statement WIP
This commit is contained in:
parent
60edd72436
commit
9eda911c24
1 changed files with 114 additions and 37 deletions
|
|
@ -8,15 +8,20 @@
|
||||||
<div class="row px-3">
|
<div class="row px-3">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="select-car-form rounded pb-1">
|
<div class="select-car-form rounded pb-1">
|
||||||
<textBlock
|
<siteSubHeader
|
||||||
|
:cmsWidgetName="SiteSubHeaderWidget"
|
||||||
|
justification="center"
|
||||||
|
|
||||||
|
/>
|
||||||
|
<!-- <textBlock
|
||||||
cmsWidgetName="verifyingCoverageStatement"
|
cmsWidgetName="verifyingCoverageStatement"
|
||||||
typeStyle="h5"
|
typeStyle="h5"
|
||||||
justifyText="center"
|
justifyText="center"
|
||||||
class="mt-4 mb-4"
|
class="mt-4 mb-4"
|
||||||
id="coverage-statement-text-block" />
|
id="coverage-statement-text-block" /> -->
|
||||||
<div>
|
<!-- <div>
|
||||||
<p v-html="continueWithSchedulingBodyText" class="mt-0 small" ></p>
|
<p v-html="continueWithSchedulingBodyText" class="mt-0 small" ></p>
|
||||||
</div>
|
</div> -->
|
||||||
<textBlock
|
<textBlock
|
||||||
cmsWidgetName="whatHappensNextCopy"
|
cmsWidgetName="whatHappensNextCopy"
|
||||||
class="mt-4 mb-2 fw-bold"
|
class="mt-4 mb-2 fw-bold"
|
||||||
|
|
@ -60,6 +65,8 @@ import { settleAllPromises } from '@/helpers/layout-helper';
|
||||||
import { getDamageString } from '@/helpers/damage-helper.js';
|
import { getDamageString } from '@/helpers/damage-helper.js';
|
||||||
import { useMainStore } from "@/store";
|
import { useMainStore } from "@/store";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
|
import { processIfStatements } from '@/helpers/cms-content-helper';
|
||||||
|
|
||||||
|
|
||||||
const store = useMainStore();
|
const store = useMainStore();
|
||||||
|
|
||||||
|
|
@ -79,7 +86,8 @@ export default {
|
||||||
return {
|
return {
|
||||||
isITAC: false,
|
isITAC: false,
|
||||||
deductible: "",
|
deductible: "",
|
||||||
policyVehicles: useMainStore().pageData(issPageValues.POLICY_VEHICLES)
|
policyVehicles: useMainStore().pageData(issPageValues.POLICY_VEHICLES),
|
||||||
|
isVerified: useMainStore().order.payment.insuranceCoverage.isVerified,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -87,6 +95,30 @@ export default {
|
||||||
this.getPriceInfo();
|
this.getPriceInfo();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
coverageStatementSubHeader() {
|
||||||
|
return this.getSubheaderTextFromCms("SiteSubHeaderWidget");
|
||||||
|
},
|
||||||
|
// coverageStatementContent() {
|
||||||
|
// if (!this.cmsWidgetName) return [];
|
||||||
|
// const cmsContent = [];
|
||||||
|
// cmsContent.push(
|
||||||
|
// {
|
||||||
|
// Name: 'SubHeader',
|
||||||
|
// cmsWidgetName: 'SiteSubHeaderWidget'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: 'ExplanatoryText',
|
||||||
|
// cmsWidgetName: 'ExplanatoryTextWidget'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: 'NextSteps',
|
||||||
|
// cmsWidgetName: 'NextStepsWidget'
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// //if cms content has not yet loaded, skip
|
||||||
|
// if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
|
||||||
|
// return {};
|
||||||
|
// }
|
||||||
bodyText() {
|
bodyText() {
|
||||||
if (useMainStore().damage.isRepair) {
|
if (useMainStore().damage.isRepair) {
|
||||||
return this.unverifiedNonADASRepairBodyText;
|
return this.unverifiedNonADASRepairBodyText;
|
||||||
|
|
@ -120,24 +152,37 @@ export default {
|
||||||
var damageString = getDamageString();
|
var damageString = getDamageString();
|
||||||
return damageString == "match" ? "" : damageString;
|
return damageString == "match" ? "" : damageString;
|
||||||
},
|
},
|
||||||
selectedVehiclePolicyInfo() {
|
// selectedVehiclePolicyInfo() {
|
||||||
const matchingVehicle = this.policyVehicles.filter(
|
// const matchingVehicle = this.policyVehicles.filter(
|
||||||
(vehicle) => vehicle.vin === store.order.vehicle.vin
|
// (vehicle) => vehicle.vin === store.order.vehicle.vin
|
||||||
)
|
// )
|
||||||
return matchingVehicle;
|
// return matchingVehicle;
|
||||||
},
|
// },
|
||||||
vehicleDeductible() {
|
vehicleDeductible() {
|
||||||
|
if (this.coverageVerified) {
|
||||||
|
if (this.store.order.damage.isRepair) {
|
||||||
|
return this.store.order.policy.deductible.repair;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this.store.order.policy.deductible.replace;
|
||||||
|
}
|
||||||
|
}
|
||||||
//console.log(this.selectedVehicle[0].coverages[0].deductible);
|
//console.log(this.selectedVehicle[0].coverages[0].deductible);
|
||||||
const deductible = this.selectedVehiclePolicyInfo[0].coverages[0].deductible;
|
//const deductible = this.selectedVehiclePolicyInfo[0].coverages[0].deductible;
|
||||||
//console.log(!this.selectedVehiclePolicyInfo[0].coverages[0]);
|
//console.log(!this.selectedVehiclePolicyInfo[0].coverages[0]);
|
||||||
return deductible;
|
//return deductible;
|
||||||
},
|
},
|
||||||
isDeductibleZero() {
|
isDeductibleZero() {
|
||||||
return this.vehicleDeductible === 0;
|
return this.vehicleDeductible === 0;
|
||||||
},
|
},
|
||||||
coverageVerified() {
|
coverageVerified() {
|
||||||
const isCoverageVerified = store.order.payment.insuranceCoverage.isVerified;
|
const isVerified = store.order.payment.insuranceCoverage.isVerified;
|
||||||
return isCoverageVerified;
|
return isVerified;
|
||||||
|
},
|
||||||
|
coverageUnverified() {
|
||||||
|
return true;
|
||||||
|
// const isUnverified = !this.coverageVerified;
|
||||||
|
// return isUnverified;
|
||||||
},
|
},
|
||||||
verifiedNoComp() {
|
verifiedNoComp() {
|
||||||
if (!this.policyVehicles.coverages || this.policyVehicles.noCoverage === true) {
|
if (!this.policyVehicles.coverages || this.policyVehicles.noCoverage === true) {
|
||||||
|
|
@ -166,7 +211,7 @@ export default {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||||
|
|
@ -194,28 +239,60 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
processIfStatements,
|
||||||
if (useMainStore().vehicle.vin) {
|
getSubheaderTextFromCms(cmsWidgetName) {
|
||||||
return true;
|
return this.getCmsContent(cmsWidgetName, 'SubHeaderText');
|
||||||
}
|
},
|
||||||
return false;
|
getBodyTextFromCms(cmsWidgetName) {
|
||||||
},
|
const bodyText = this.getCmsContent(cmsWidgetName, "BodyText");
|
||||||
getPriceInfo() {
|
return this.processIfStatements(bodyText, "custom", this.getCustomValueFromString);
|
||||||
const servicePrice = store.getPriceOrderItems();
|
},
|
||||||
|
getSecondaryTextFromCms(cmsWidgetName) {
|
||||||
if (servicePrice > this.vehicleDeductible) {
|
const secondaryText = this.getCmsContent(cmsWidgetName, "SecondaryText");
|
||||||
return this.isITAC = true;
|
return this.processIfStatements(secondaryText, "custom", this.getCustomValueFromString);
|
||||||
|
},
|
||||||
|
arePagePrerequisitesValid() {
|
||||||
|
if (useMainStore().vehicle.vin) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
return false;
|
||||||
async forwardButtonAction() {
|
},
|
||||||
return this.navigateForward();
|
getCustomValueFromString(str) {
|
||||||
},
|
switch (str) {
|
||||||
navigateForward() {
|
case 'coverageUnverified':
|
||||||
this.$router.navigate(
|
return this.coverageUnverified;
|
||||||
this.navigationScenarios.CLICKED_FORWARD,
|
case 'verifiedDeductible':
|
||||||
this.$route
|
return this.verifiedDeductible;
|
||||||
);
|
case 'verifiedITAC':
|
||||||
},
|
return this.verifiedITAC;
|
||||||
|
case 'verifiedNoComp':
|
||||||
|
return this.verifiedNoComp;
|
||||||
|
case 'ADASReplace':
|
||||||
|
return this.ADASReplace;
|
||||||
|
case 'nonADASReplace':
|
||||||
|
return this.nonADASReplace;
|
||||||
|
case 'nonADASRepair':
|
||||||
|
return this.nonADASRepair;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPriceInfo() {
|
||||||
|
const servicePrice = store.getPriceOrderItems();
|
||||||
|
|
||||||
|
if (servicePrice > this.vehicleDeductible) {
|
||||||
|
return this.isITAC = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async forwardButtonAction() {
|
||||||
|
return this.navigateForward();
|
||||||
|
},
|
||||||
|
navigateForward() {
|
||||||
|
this.$router.navigate(
|
||||||
|
this.navigationScenarios.CLICKED_FORWARD,
|
||||||
|
this.$route
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue