CSR-731 | Demo-ready commit

This commit is contained in:
Scott Kiener 2022-10-12 15:34:02 -04:00
parent 631db97a15
commit 18b508a550
3 changed files with 54 additions and 100 deletions

View file

@ -38,75 +38,17 @@
typeStyle="caption" typeStyle="caption"
class="mt-4" class="mt-4"
/> />
<h3 style="m-0">h1</h3> <modal
<textBlock cmsWidgetName="EstimateRainDefenseModal"
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="h1"
class="mt-4"
/> />
<h3 style="m-0">h2</h3> <modal
<textBlock cmsWidgetName="EstimateFrontWiperModal"
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="h2"
class="mt-4"
/> />
<h3 style="m-0">h3</h3> <modal
<textBlock cmsWidgetName="EstimateRearWiperModal"
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="h3"
class="mt-4"
/> />
<h3 style="m-0">h4</h3> <modal
<textBlock cmsWidgetName="EstimateRecalModal"
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="h4"
class="mt-4"
/>
<h3 style="m-0">h5</h3>
<textBlock
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="h5"
class="mt-4"
/>
<h3 style="m-0">h6</h3>
<textBlock
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="h6"
class="mt-4"
/>
<h3 style="m-0">Body</h3>
<textBlock
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="body"
class="mt-4"
/>
<h3 style="m-0">Label</h3>
<textBlock
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="label"
class="mt-4"
/>
<h3 style="m-0">Small</h3>
<textBlock
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="small"
class="mt-4"
/>
<h3 style="m-0">Caption</h3>
<textBlock
cmsWidgetName="quoteDisclaimer"
justifyText="left"
typeStyle="caption"
class="mt-4"
/> />
<funnel-footer <funnel-footer
cmsWidgetName="FunnelFooterWidget" cmsWidgetName="FunnelFooterWidget"
@ -129,7 +71,9 @@ import funnelSubHeader from "@/common-components/funnel-sub-header/funnel-sub-he
import cashOrInsuranceQuestion from "./cash-or-insurance-question/cash-or-insurance-question"; import cashOrInsuranceQuestion from "./cash-or-insurance-question/cash-or-insurance-question";
import servicePackageQuestion from "./service-package-question/service-package-question"; import servicePackageQuestion from "./service-package-question/service-package-question";
import textBlock from "@/common-components/text-block/text-block"; import textBlock from "@/common-components/text-block/text-block";
import modal from "@/common-components/modal/modal";
import store from "@/store"; import store from "@/store";
import baseMixin from "@/mixins/base-mixin.js";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { Form } from "vee-validate"; import { Form } from "vee-validate";
@ -157,53 +101,55 @@ export default {
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next((vm) => {
vm.setCmsContent(cmsContent); vm.setCmsContent(cmsContent);
vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue();
vm.selectedPackage = vm.getDefaultSelectedPackageValue(); vm.selectedPackage = vm.getDefaultSelectedPackageValue();
vm.lineItems = [ vm.lineItems = [
{ {
PartNumber : "001", PartNumber : "001",
Description : "Windshield with Recal", Description : "Windshield with Recal",
PartType : "Windshield", partType : "Windshield",
Quantity : "1", Quantity : "1",
BasePartNumber : "001", BasePartNumber : "001",
Color : "Green", Color : "Green",
CanSafeliteRecalibrate: true, CanSafeliteRecalibrate: true,
Price : 350.00 price : 350.22
}, },
{ {
PartNumber : "002", "partNumber": "SBB16",
Description : "Front Wipers", "description": "SAFELITE BEAM BLADE 16",
PartType : "frontWiper", "partType": "PASSENGER FRONT WIPER",
Quantity : "1", "price": 32.64,
Price : 35.00,
}, },
{ {
PartNumber : "003", "partNumber": "SBB26",
Description : "Rear Wiper", "description": "SAFELITE BEAM BLADE 26",
PartType : "rearWiper", "partType": "DRIVER FRONT WIPER",
Quantity : "1", "price": 53.04,
Price : 25.00,
}, },
{ {
PartNumber : "004", "partNumber": "SBBR12A",
Description : "Rain Defense", "description": "SAFELITE REAR BLADE 12A",
PartType : "rainDefense", "partType": "REAR WIPER",
Quantity : "1", "price": 24.48,
Price : 30.00, },
{
"partNumber": "RAIN DEFENSE",
"description": null,
"partType": "RAIN DEFENSE",
"price": 35.50,
}, },
{ {
PartNumber : "005", PartNumber : "005",
Description : "Recalibration", Description : "Recalibration",
PartType : "recalibration", partType : "recalibration",
Quantity : "1", Quantity : "1",
Price : 150.00, price : 150.00,
}, },
]; ];
vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue();
}); });
}, },
data(){ data(){
return { return {
cashOrInsuranceThreshhold: 600,
pricingRequestResult: null, pricingRequestResult: null,
isInsuranceSelected: null, isInsuranceSelected: null,
selectedPackage: null, selectedPackage: null,
@ -219,7 +165,7 @@ export default {
if(defaultIsInsuranceSelectedValue != null) { if(defaultIsInsuranceSelectedValue != null) {
return defaultIsInsuranceSelectedValue; return defaultIsInsuranceSelectedValue;
} else { } else {
return this.economyPackagePrice > this.cashOrInsuranceThreshhold; return baseMixin.methods.getEconomyPackagePrice(this.lineItems) > 600;
} }
}, },
getDefaultSelectedPackageValue() { getDefaultSelectedPackageValue() {
@ -246,6 +192,7 @@ export default {
textBlock, textBlock,
cashOrInsuranceQuestion, cashOrInsuranceQuestion,
servicePackageQuestion, servicePackageQuestion,
modal,
}, },
}; };

View file

@ -69,10 +69,10 @@ export default {
return this.getArrayOfListItemsFromRawCmsCopy(this.getBodyTextFromCms); return this.getArrayOfListItemsFromRawCmsCopy(this.getBodyTextFromCms);
}, },
isRecalibrationOnOrder() { isRecalibrationOnOrder() {
return this.lineItemsContainsPartType("recalibration"); return this.lineItemsContainsPartType("RECALIBRATION");
}, },
frontWipersApplicableForStandard() { frontWipersApplicableForStandard() {
const frontWipersAreAvailable = this.lineItemsContainsPartType("frontWiper"); const frontWipersAreAvailable = this.lineItemsContainsPartType("FRONT WIPER");
const isRepair = this.$store.getters.order.damage.isRepair; const isRepair = this.$store.getters.order.damage.isRepair;
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation("Windshield"); const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation("Windshield");
if (frontWipersAreAvailable) { if (frontWipersAreAvailable) {
@ -90,19 +90,19 @@ export default {
} }
}, },
rearWiperApplicableForStandard() { rearWiperApplicableForStandard() {
const rearWiperIsAvailable = this.lineItemsContainsPartType("rearWiper"); const rearWiperIsAvailable = this.lineItemsContainsPartType("REAR WIPER");
return this.glassToReplaceContainsGlassLocation("Rear") && rearWiperIsAvailable; return this.glassToReplaceContainsGlassLocation("Rear") && rearWiperIsAvailable;
}, },
frontWipersApplicableForPremium() { frontWipersApplicableForPremium() {
const frontWipersAreAvailable = this.lineItemsContainsPartType("frontWiper"); const frontWipersAreAvailable = this.lineItemsContainsPartType("FRONT WIPER");
return frontWipersAreAvailable; return frontWipersAreAvailable;
}, },
rearWiperApplicableForPremium() { rearWiperApplicableForPremium() {
const rearWiperIsAvailable = this.lineItemsContainsPartType("rearWiper"); const rearWiperIsAvailable = this.lineItemsContainsPartType("REAR WIPER");
return this.glassToReplaceContainsGlassLocation("Rear") && rearWiperIsAvailable; return this.glassToReplaceContainsGlassLocation("Rear") && rearWiperIsAvailable;
}, },
rainDefenseApplicableForPremium() { rainDefenseApplicableForPremium() {
const frontWipersAreAvailable = this.lineItemsContainsPartType("frontWiper"); const frontWipersAreAvailable = this.lineItemsContainsPartType("FRONT WIPER");
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation("Windshield"); const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation("Windshield");
const glassToReplaceContainsRearGlass = this.glassToReplaceContainsGlassLocation("Rear"); const glassToReplaceContainsRearGlass = this.glassToReplaceContainsGlassLocation("Rear");
if(this.frontWipersApplicableForStandard) { if(this.frontWipersApplicableForStandard) {
@ -155,7 +155,7 @@ export default {
return this[str]; return this[str];
}, },
lineItemsContainsPartType(partType) { lineItemsContainsPartType(partType) {
const results = this.additionalData.lineItems.filter(lineItem => lineItem.PartType === partType); const results = this.additionalData.lineItems.filter(lineItem => lineItem.partType.toUpperCase().includes(partType));
return !!results.length; return !!results.length;
}, },
glassToReplaceContainsGlassLocation(glassLocation) { glassToReplaceContainsGlassLocation(glassLocation) {
@ -176,8 +176,8 @@ export default {
const priceFrontWipers = this.frontWipersApplicableForStandard; const priceFrontWipers = this.frontWipersApplicableForStandard;
const priceRearWipers = this.rearWiperApplicableForStandard; const priceRearWipers = this.rearWiperApplicableForStandard;
this.additionalData.lineItems.forEach(item => { this.additionalData.lineItems.forEach(item => {
if ((priceFrontWipers && item.PartType === "frontWiper") || (priceRearWipers && item.PartType === "rearWiper")) { if ((priceFrontWipers && item.partType.toUpperCase().includes("FRONT WIPER")) || (priceRearWipers && item.partType.toUpperCase().includes("REAR WIPER"))) {
vapsPrice += item.Price; vapsPrice += item.price;
} }
}); });
return vapsPrice; return vapsPrice;
@ -188,8 +188,8 @@ export default {
const priceRearWipers = this.rearWiperApplicableForPremium; const priceRearWipers = this.rearWiperApplicableForPremium;
const priceRainDefense = this.rainDefenseApplicableForPremium; const priceRainDefense = this.rainDefenseApplicableForPremium;
this.additionalData.lineItems.forEach(item => { this.additionalData.lineItems.forEach(item => {
if ((priceFrontWipers && item.PartType === "frontWiper") || (priceRearWipers && item.PartType === "rearWiper") || (priceRainDefense && item.PartType === "rainDefense")) { if ((priceFrontWipers && item.partType.toUpperCase().includes("FRONT WIPER")) || (priceRearWipers && item.partType.toUpperCase().includes("REAR WIPER")) || (priceRainDefense && item.partType.toUpperCase().includes("RAIN DEFENSE"))) {
vapsPrice += item.Price; vapsPrice += item.price;
} }
}); });
return vapsPrice; return vapsPrice;
@ -290,6 +290,13 @@ export default {
} }
} }
.package-footer {
font-size: 12px;
font-weight: 500;
color: #D4281C;
margin-left: -32px;
}
.package-specs { .package-specs {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View file

@ -62,7 +62,7 @@ export default {
return lineItem.PartType != "frontWiper" && lineItem.PartType != "rearWiper" && lineItem.PartType != "rainDefense"; return lineItem.PartType != "frontWiper" && lineItem.PartType != "rearWiper" && lineItem.PartType != "rainDefense";
}); });
let totalPrice = 0; let totalPrice = 0;
nonVapsItems.forEach(item => totalPrice += item.Price); nonVapsItems.forEach(item => totalPrice += item.price);
return totalPrice; return totalPrice;
} }
}, },