WIP - Cart Styling
This commit is contained in:
parent
50cd865af4
commit
4d7f01d87e
2 changed files with 66 additions and 9 deletions
|
|
@ -46,14 +46,31 @@
|
||||||
|
|
||||||
<!-- Fees -->
|
<!-- Fees -->
|
||||||
<div v-if="recycleFeeCartItem">
|
<div v-if="recycleFeeCartItem">
|
||||||
<span>{{ recycleFeeCartItem.name }}</span
|
<textLink
|
||||||
><span>{{ currencyFormatter.format(recycleFeeCartItem.subTotal) }}</span>
|
linkType="text"
|
||||||
|
:text="recycleFeeCartItem.name"
|
||||||
|
href="#!"
|
||||||
|
@click-event="openModal(recyclingModal)" />
|
||||||
|
<span>{{ currencyFormatter.format(recycleFeeCartItem.subTotal) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="mobileFeeCartItem">
|
<div v-if="mobileFeeCartItem">
|
||||||
<span>{{ mobileFeeCartItem.name }}</span
|
<span>{{ mobileFeeCartItem.name }}</span
|
||||||
><span>{{ currencyFormatter.format(mobileFeeCartItem.subTotal) }}</span>
|
><span>{{ currencyFormatter.format(mobileFeeCartItem.subTotal) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="premiumAppointmentDiscountCartItem">
|
||||||
|
<span>{{ premiumAppointmentDiscountCartItem.name }}</span>
|
||||||
|
<textLink
|
||||||
|
ref="removeLink"
|
||||||
|
linkType="text"
|
||||||
|
:text="removeLinkText"
|
||||||
|
href="#!"
|
||||||
|
@click-event="removeItem(PREMIUM_FEE_PART_TYPE, 'supportingItems')" />
|
||||||
|
<span>{{ currencyFormatter.format(premiumAppointmentDiscountCartItem.subTotal) }}</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- promos here -->
|
||||||
|
|
||||||
<!-- Sub total, sales tax, total columns -->
|
<!-- Sub total, sales tax, total columns -->
|
||||||
<div class="sub-total">
|
<div class="sub-total">
|
||||||
<span>{{ subtotalText }}</span
|
<span>{{ subtotalText }}</span
|
||||||
|
|
@ -86,6 +103,7 @@ import { getHighestFullySatisfiedTier, getPackageContents } from "@/helpers/serv
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
|
import { PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants";
|
||||||
import { cartItemCategories } from "@/constants/cart-item-categories";
|
import { cartItemCategories } from "@/constants/cart-item-categories";
|
||||||
import { cartItemTypes } from "@/constants/cart-item-types";
|
import { cartItemTypes } from "@/constants/cart-item-types";
|
||||||
|
|
||||||
|
|
@ -216,6 +234,10 @@ export default {
|
||||||
cartItems.push(cartItem);
|
cartItems.push(cartItem);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.premiumAppointmentDiscountCartItem) {
|
||||||
|
cartItems.push(this.premiumAppointmentDiscountCartItem);
|
||||||
|
}
|
||||||
|
|
||||||
return cartItems;
|
return cartItems;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -294,7 +316,7 @@ export default {
|
||||||
const nonpackageCartItems = [];
|
const nonpackageCartItems = [];
|
||||||
|
|
||||||
this.cartItems.forEach((cartItem) => {
|
this.cartItems.forEach((cartItem) => {
|
||||||
if (cartItem == this.recycleFeeCartItem || cartItem == this.mobileFeeCartItem) {
|
if (cartItem == this.recycleFeeCartItem || cartItem == this.mobileFeeCartItem || cartItem == this.premiumAppointmentDiscountCartItem) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -470,8 +492,8 @@ export default {
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
//recycleFeeLineItem.cartItemType = cartItem.cartItemType;
|
recycleFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||||
//cartItem.lineItems.push(recycleFeeLineItem);
|
cartItem.lineItems.push(recycleFeeLineItem);
|
||||||
|
|
||||||
cartItem.subTotal +=
|
cartItem.subTotal +=
|
||||||
(recycleFeeLineItem.kitPrice ?? 0) +
|
(recycleFeeLineItem.kitPrice ?? 0) +
|
||||||
|
|
@ -552,6 +574,40 @@ export default {
|
||||||
|
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
|
premiumAppointmentDiscountCartItemName() {
|
||||||
|
return "Early bird appointment"; // TODO: get from CMS
|
||||||
|
},
|
||||||
|
premiumAppointmentDiscountCartItem() {
|
||||||
|
let cartItem = null;
|
||||||
|
|
||||||
|
const premiumAppointmentDiscountLineItem = this.supportingItems.find(
|
||||||
|
(lineItem) => lineItem.partNumber == PREMIUM_FEE_PART_TYPE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (premiumAppointmentDiscountLineItem) {
|
||||||
|
cartItem = {
|
||||||
|
name: this.premiumAppointmentDiscountCartItemName,
|
||||||
|
category: cartItemCategories.SUPPORTING_ITEMS,
|
||||||
|
cartItemType: PREMIUM_FEE_PART_TYPE,
|
||||||
|
isDisplayed: true,
|
||||||
|
subTotal: 0,
|
||||||
|
salesTax: 0,
|
||||||
|
lineItems: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
cartItem.lineItems.push(premiumAppointmentDiscountLineItem);
|
||||||
|
|
||||||
|
cartItem.subTotal +=
|
||||||
|
(premiumAppointmentDiscountLineItem.kitPrice ?? 0) +
|
||||||
|
(premiumAppointmentDiscountLineItem.laborAmount ?? 0) +
|
||||||
|
(premiumAppointmentDiscountLineItem.sellingPrice ?? 0);
|
||||||
|
|
||||||
|
cartItem.salesTax += premiumAppointmentDiscountLineItem.salesTax ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return cartItem;
|
||||||
|
},
|
||||||
removeLinkText() {
|
removeLinkText() {
|
||||||
return this.getCmsContent("RemoveCartItemTextWidget", "Text");
|
return this.getCmsContent("RemoveCartItemTextWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
@ -643,7 +699,7 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
span {
|
span {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 33.33333%;
|
font-size: 0.875rem;
|
||||||
&:nth-child(2) {
|
&:nth-child(2) {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@
|
||||||
|
|
||||||
<funnelSubHeader
|
<funnelSubHeader
|
||||||
class="mb-5 mt-4"
|
class="mb-5 mt-4"
|
||||||
cmsWidgetName="FunnelSubHeaderWidget"
|
cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
leftAlignHeader />
|
|
||||||
|
|
||||||
<p v-if="isPiaDisabled" class="fw-normal no-pia-disclaimer">
|
<p v-if="isPiaDisabled" class="fw-normal no-pia-disclaimer">
|
||||||
<span>{{ noPiaDisclaimer }}</span>
|
<span>{{ noPiaDisclaimer }}</span>
|
||||||
|
|
@ -31,6 +30,8 @@
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
@cart-remove="cartRemove" />
|
@cart-remove="cartRemove" />
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<alert
|
<alert
|
||||||
ref="piaErrorAlert"
|
ref="piaErrorAlert"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue