WIP
This commit is contained in:
parent
512c73413d
commit
d9203a4edd
3 changed files with 52 additions and 14 deletions
|
|
@ -11,21 +11,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="price-table">
|
<div class="price-table">
|
||||||
<div class="service-type">
|
<div class="service-type" :class="{ packageWithVAPS: packageWithVAPS }">
|
||||||
<textBlock :cmsWidgetName="packageNameWidget" />
|
<textBlock :cmsWidgetName="packageNameWidget" /><span>{{packagePrice}}</span>
|
||||||
<span>$300</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="small vaps">
|
<div class="vaps">
|
||||||
<span>Wiper blades</span><span><a href="#">Remove</a></span>
|
<span>Wiper blades</span><span><a href="#">Remove</a></span><span v-if="!packageWithVAPS">$10</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="small vaps">
|
<div class="vaps">
|
||||||
<span>Rain defense</span><span><a href="#">Remove</a></span>
|
<span>Rain defense</span><span><a href="#">Remove</a></span><span v-if="!packageWithVAPS">$10</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="hasRecycleLineItem"><span>{{recycleLabel}}</span><span>{{recycleFee}}</span></div>
|
<div v-if="hasRecycleLineItem"><span>{{recycleLabel}}</span><span>{{recycleFee}}</span></div>
|
||||||
<div class="service-type"><span>Mobile service</span><span>$10</span></div>
|
<div class="service-type"><span>Mobile service</span><span>$10</span></div>
|
||||||
<div class="align-items-center">
|
|
||||||
<span>Rain Defense</span><a href="#">Remove</a><span>$10</span>
|
|
||||||
</div>
|
|
||||||
<div class="sub-total"><span>Subtotal</span><span>$320</span></div>
|
<div class="sub-total"><span>Subtotal</span><span>$320</span></div>
|
||||||
<div class="sales-tax"><span>Sales tax</span><span>$1</span></div>
|
<div class="sales-tax"><span>Sales tax</span><span>$1</span></div>
|
||||||
<div class="amount-due"><span>Amount due</span><span>$321</span></div>
|
<div class="amount-due"><span>Amount due</span><span>$321</span></div>
|
||||||
|
|
@ -36,6 +32,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import cart from "@/fmg-components/cart/cart";
|
import cart from "@/fmg-components/cart/cart";
|
||||||
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import {
|
import {
|
||||||
getHighestFullySatisfiedTier,
|
getHighestFullySatisfiedTier,
|
||||||
|
|
@ -56,6 +53,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
isActive: false,
|
isActive: false,
|
||||||
availableVaps: [],
|
availableVaps: [],
|
||||||
|
packageWithVAPS: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -66,6 +64,32 @@ export default {
|
||||||
const vapsFromApi = [...apiResponses.wipers, apiResponses.rainDefense];
|
const vapsFromApi = [...apiResponses.wipers, apiResponses.rainDefense];
|
||||||
this.availableVaps = vapsFromApi;
|
this.availableVaps = vapsFromApi;
|
||||||
},
|
},
|
||||||
|
getPackagePriceString(packageName) {
|
||||||
|
const formattedPriceFloat = parseFloat(this.getPackagePrice(packageName)).toFixed(2);
|
||||||
|
return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat;
|
||||||
|
},
|
||||||
|
getPackagePrice(packageName) {
|
||||||
|
let priceFloat = this.isInsuranceSelected
|
||||||
|
? 0
|
||||||
|
: baseMixin.methods.getTierOnePackagePrice(
|
||||||
|
baseMixin.methods.filterOutFees(this.nullSafeAvailableLineItems)
|
||||||
|
);
|
||||||
|
|
||||||
|
priceFloat += this.getVapsPrice(packageName);
|
||||||
|
|
||||||
|
return priceFloat;
|
||||||
|
},
|
||||||
|
getVapsPrice(packageName) {
|
||||||
|
const vapsItems = this.getVapsLineItemsForSelectedPackage(packageName);
|
||||||
|
|
||||||
|
let price = 0;
|
||||||
|
|
||||||
|
vapsItems.forEach((item) => {
|
||||||
|
price += baseMixin.methods.getTotalLineItemPrice(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
return price;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
packageNameWidget() {
|
packageNameWidget() {
|
||||||
|
|
@ -92,6 +116,9 @@ export default {
|
||||||
this.vaps
|
this.vaps
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
packagePrice() {
|
||||||
|
return "$450";
|
||||||
|
},
|
||||||
glassToReplace() {
|
glassToReplace() {
|
||||||
return this.damage.glassToReplace;
|
return this.damage.glassToReplace;
|
||||||
},
|
},
|
||||||
|
|
@ -151,6 +178,9 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0.5rem 1.5rem;
|
padding: 0.5rem 1.5rem;
|
||||||
|
&:nth-child(odd) {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
&:nth-last-child(-n + 3) {
|
&:nth-last-child(-n + 3) {
|
||||||
background-color: #e3f2ea;
|
background-color: #e3f2ea;
|
||||||
}
|
}
|
||||||
|
|
@ -159,13 +189,10 @@ export default {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.vaps {
|
|
||||||
padding-left: 2.5rem;
|
|
||||||
}
|
|
||||||
.package-type,
|
.package-type,
|
||||||
.service-type,
|
.service-type,
|
||||||
.vaps {
|
.vaps {
|
||||||
background-color: #f5f5f5;
|
//background-color: #f5f5f5;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.sub-total,
|
.sub-total,
|
||||||
|
|
@ -177,11 +204,18 @@ export default {
|
||||||
border-top: 1px solid #0c7e47;
|
border-top: 1px solid #0c7e47;
|
||||||
}
|
}
|
||||||
.service-type {
|
.service-type {
|
||||||
|
// background-color: #f5f5f5;
|
||||||
.text-block {
|
.text-block {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
&.packageWithVAPS {
|
||||||
|
~ .vaps {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
padding-left: 2.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.vin-toggle {
|
.vin-toggle {
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ export default {
|
||||||
buttonAuxillaryCopy: this.getPackagePriceString(answer.Name),
|
buttonAuxillaryCopy: this.getPackagePriceString(answer.Name),
|
||||||
buttonFooterCopy: this.getFooterTextFromCms(answer.SubWidgetName),
|
buttonFooterCopy: this.getFooterTextFromCms(answer.SubWidgetName),
|
||||||
}));
|
}));
|
||||||
|
console.log("avialable packages is", modifiedAnswers)
|
||||||
return modifiedAnswers;
|
return modifiedAnswers;
|
||||||
},
|
},
|
||||||
isRecalibrationOnOrder() {
|
isRecalibrationOnOrder() {
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ export default {
|
||||||
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
console.log("step one", lineItemsToPrice);
|
||||||
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice);
|
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice);
|
||||||
return totalPrice;
|
return totalPrice;
|
||||||
},
|
},
|
||||||
|
|
@ -93,7 +94,9 @@ export default {
|
||||||
lineItem.childParts
|
lineItem.childParts
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
console.log("step two, lineItem name: ", lineItem.partNumber, " / totalPrice: ", totalPrice);
|
||||||
});
|
});
|
||||||
|
console.log("step three", totalPrice);
|
||||||
return totalPrice;
|
return totalPrice;
|
||||||
},
|
},
|
||||||
getTotalLineItemPrice(lineItem) {
|
getTotalLineItemPrice(lineItem) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue