WIP
This commit is contained in:
parent
61abcbb5d8
commit
f4d8cd3f4f
8 changed files with 57 additions and 33 deletions
|
|
@ -65,6 +65,7 @@ export default {
|
|||
name: "donationBlock",
|
||||
props: {
|
||||
cmsWidgetName: String,
|
||||
modelValue: String,
|
||||
},
|
||||
computed: {
|
||||
DonationHeadline() {
|
||||
|
|
@ -91,6 +92,14 @@ export default {
|
|||
LogoImage() {
|
||||
return this.getCmsContent("DonationWidget", "Image");
|
||||
},
|
||||
selectedValue: {
|
||||
get: function () {
|
||||
return this.modelValue?.toString();
|
||||
},
|
||||
set: function (newValue) {
|
||||
this.$emit("update:modelValue", newValue);
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -65,12 +65,17 @@
|
|||
:isNoComp="isNoComp" />
|
||||
|
||||
<div class="mt-3">
|
||||
<donationBlock cmsWidgetName="DonationWidget" />
|
||||
<donationBlock
|
||||
cmsWidgetName="DonationWidget"
|
||||
v-model="donationAmount"
|
||||
:donationValues="donationValues" />
|
||||
</div>
|
||||
|
||||
<h3>donationAdded: {{ donationAdded }}</h3>
|
||||
|
||||
<button type="button" @click="addDonation(3)">Add Donation of $3</button>
|
||||
<h3>donationAmount: {{ donationAmount }}</h3>
|
||||
|
||||
<!-- <button type="button" @click="addDonation(3)">
|
||||
Add Donation of $3
|
||||
</button> -->
|
||||
|
||||
<hr class="mb-5" />
|
||||
|
||||
|
|
@ -456,7 +461,10 @@ export default {
|
|||
);
|
||||
}
|
||||
},
|
||||
donationAdded() {
|
||||
donationValues() {
|
||||
return [1,3,5];
|
||||
},
|
||||
donationAmount() {
|
||||
const donationItems = this.submittedOrder?.lineItems?.supportingItems?.filter(
|
||||
(item) => item.partNumber === "DONATION"
|
||||
);
|
||||
|
|
@ -507,13 +515,22 @@ export default {
|
|||
forwardButtonAction() {
|
||||
window.location.assign(location.protocol + "//" + location.host);
|
||||
},
|
||||
addDonation(amount) {
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
async addDonation(amount) {
|
||||
// try to call API to add donation to order
|
||||
|
||||
// TODO - change the following to check the response from the call
|
||||
const donationResponse = await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.ADD_DONATION_TO_SUBMITTED_ORDER,
|
||||
amount,
|
||||
false
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
donationAmount(newValue) {
|
||||
console.log("WATCHED donationAmount changed: ", newValue)
|
||||
this.addDonation(newValue);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
funnelHeader,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
linkType="text"
|
||||
:text="payWithCashButtonCopy"
|
||||
href="javascript:void(0)"
|
||||
@click-event="backButtonAction(foreceCashSelectionOnQuote = true)" />
|
||||
@click-event="backButtonAction((foreceCashSelectionOnQuote = true))" />
|
||||
|
||||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
|
|
@ -102,7 +102,7 @@ export default {
|
|||
},
|
||||
payWithCashButtonCopy() {
|
||||
return this.getCmsContent("PayWithCashWidget", "Text");
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isCashParentAccountNumber() {
|
||||
|
|
@ -123,10 +123,14 @@ export default {
|
|||
backButtonAction(forceCashSelectionOnQuote) {
|
||||
// Go back to Quote page
|
||||
if (forceCashSelectionOnQuote) {
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route, {"isCashSelected": true});
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_BACK,
|
||||
this.$route,
|
||||
{ isCashSelected: true }
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ export default {
|
|||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -612,14 +612,10 @@ describe("quote.vue", () => {
|
|||
mockTierOnePrice = 505;
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
||||
//Act
|
||||
await quote.beforeRouteEnter.call(
|
||||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote",
|
||||
isInsuranceSelected: true,
|
||||
isCashSelected: true,
|
||||
} },
|
||||
{ query: { fmgPage: "quote", isInsuranceSelected: true, isCashSelected: true } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -206,8 +206,7 @@ export default {
|
|||
if (!this.emailOrSms) {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
|
|
|
|||
|
|
@ -3157,22 +3157,21 @@ export const actions = {
|
|||
},
|
||||
|
||||
addDonationToSubmittedOrder(context, donationAmount) {
|
||||
|
||||
console.log("running addDonationToSubmittedOrder()... donationAmount: ", donationAmount)
|
||||
console.log("running addDonationToSubmittedOrder()... donationAmount: ", donationAmount);
|
||||
|
||||
const submittedOrder = deepClone(baseMixin.methods.getSubmittedOrder());
|
||||
|
||||
submittedOrder.lineItems.supportingItems.push({
|
||||
"partNumber": "DONATION",
|
||||
"description": null,
|
||||
"partType": "DONATION",
|
||||
"isInsurable": false,
|
||||
"isChildPart": false,
|
||||
"laborAmount": 0,
|
||||
"sellingPrice": donationAmount,
|
||||
"kitPrice": 0,
|
||||
"salesTax": null,
|
||||
"id": "donation-" + donationAmount,
|
||||
partNumber: "DONATION",
|
||||
description: null,
|
||||
partType: "DONATION",
|
||||
isInsurable: false,
|
||||
isChildPart: false,
|
||||
laborAmount: 0,
|
||||
sellingPrice: donationAmount,
|
||||
kitPrice: 0,
|
||||
salesTax: null,
|
||||
id: "donation-" + donationAmount,
|
||||
});
|
||||
|
||||
// set to local storage
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
process.env.VUE_APP_CONSUMER_CF_DISTRO = "https://digitalapi.dev.safelite.io";
|
||||
process.env.VUE_APP_CONSUMER_CF_DISTRO = "https://digitalapi.qa.safelite.io";
|
||||
//process.env.VUE_APP_HERITAGE_FUNNEL = "http://localhost:38000/default.aspx";
|
||||
process.env.VUE_APP_HERITAGE_FUNNEL = "https://fixmyglassdev.safelite.com/default.aspx";
|
||||
process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "AIzaSyDptGCkOPgN2uWJOy4ou4M33phRD4MAoJo";
|
||||
|
|
|
|||
Loading…
Reference in a new issue