Merge pull request #1452 from Safelite/feature/CSR-1392
Feature/csr 1392
This commit is contained in:
commit
dd83c34b98
1 changed files with 23 additions and 20 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form>
|
||||||
<loadingModal notFullScreen ref="loadingModal" />
|
<loadingModal notFullScreen ref="loadingModal" />
|
||||||
<div class="container-fluid page-container-grouped-styles">
|
<div class="container-fluid page-container-grouped-styles">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
|
|
@ -23,11 +23,10 @@
|
||||||
<div class="fade-on-route-transition sub-container make-tall">
|
<div class="fade-on-route-transition sub-container make-tall">
|
||||||
<navbar
|
<navbar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
isForwardActionDisabled="true"
|
||||||
:isBackButtonHidden="shouldHideBackButton"
|
:isBackButtonHidden="shouldHideBackButton"
|
||||||
isSubmitHidden="true"
|
isSubmitHidden="true"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction" />
|
||||||
@ForwardClicked="forwardButtonAction" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -172,7 +171,6 @@ import { paymentMethods } from "@/constants/payment-method-constants";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
import { Form } from "vee-validate";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "payment",
|
name: "payment",
|
||||||
|
|
@ -311,26 +309,24 @@ export default {
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
getPiaLineItems() {
|
getPiaLineItems() {
|
||||||
const itemsClone = { ...store.getters.order.lineItems };
|
|
||||||
delete itemsClone.serverData;
|
|
||||||
|
|
||||||
var itemsForPia = "";
|
var itemsForPia = "";
|
||||||
for (var propertyName in itemsClone) {
|
var glassParts = store.getters.order.lineItems.glassParts;
|
||||||
for (var item in itemsClone[propertyName]) {
|
var supportingItems = store.getters.order.lineItems.supportingItems;
|
||||||
var amount =
|
var vaps = store.getters.order.lineItems.vaps;
|
||||||
+itemsClone[propertyName][item].laborAmount +
|
const items = [...(glassParts ?? []), ...(supportingItems ?? []), ...(vaps ?? [])];
|
||||||
+itemsClone[propertyName][item].sellingPrice;
|
|
||||||
itemsForPia += itemsClone[propertyName][item].partType + "|" + amount + "|1|";
|
for (var i = 0; i < items.length; i++) {
|
||||||
}
|
var amount = items[i].laborAmount + items[i].sellingPrice;
|
||||||
|
itemsForPia += items[i].partType + "|" + amount + "|1|";
|
||||||
}
|
}
|
||||||
return itemsForPia;
|
return itemsForPia;
|
||||||
},
|
},
|
||||||
getAmountDue() {
|
getAmountDue() {
|
||||||
return 2;
|
return 1600;
|
||||||
//return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
//return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
||||||
},
|
},
|
||||||
getDisplayAmountDue() {
|
getDisplayAmountDue() {
|
||||||
return "$2.00";
|
return "$1600.00";
|
||||||
//return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
//return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
||||||
},
|
},
|
||||||
isPaypal() {
|
isPaypal() {
|
||||||
|
|
@ -340,9 +336,17 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
// The only way I could figure out how to get navigation to work on a page with the iframe.
|
||||||
|
// This is also how a cancel from Paypal would work. Just a redirect to the payment-method page.
|
||||||
|
// The normal navigation sort of works but the page does not render. The "next" callback function does not get
|
||||||
|
// invoked in payment-method's beforeroute enter. I also spotted an error in vue-router.esm-bundler.js when this
|
||||||
|
// happens but was unable to ignore it with a try catch. The navigation guard error is:
|
||||||
|
// Error: Redirected from "/?fmgPage=payment-method" to "{ params: {isSavingNation: "false"}, query: "fmgPage: "payment-method"}"
|
||||||
|
// I don't know if the navigation guard thinks the to and from are the same page.
|
||||||
|
// Also tried overriding with a $router.push
|
||||||
|
window.location = applicationConfig.PIA_CANCEL_URL;
|
||||||
|
//this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
},
|
},
|
||||||
forwardButtonAction() {},
|
|
||||||
async fetchSignatureInfo() {
|
async fetchSignatureInfo() {
|
||||||
if (this.isPaypal()) {
|
if (this.isPaypal()) {
|
||||||
this.$refs.loadingModal.showModal();
|
this.$refs.loadingModal.showModal();
|
||||||
|
|
@ -371,7 +375,6 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
navbar,
|
||||||
Form,
|
|
||||||
loadingModal,
|
loadingModal,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue