80 lines
2.8 KiB
Vue
80 lines
2.8 KiB
Vue
fmg
|
|
<template>
|
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
|
<div class="page-container-grouped-styles">
|
|
<funnelHeader cmsWidgetName="FunnelHeaderWidget" />
|
|
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
|
<serviceZipModalQuestion
|
|
cmsWidgetName="ServiceZipModalWidget"
|
|
modalWidgetName="ZipModalWidget"
|
|
textboxQuestionWidgetName="ServiceZipQuestionWidget"
|
|
alertNonServiceableZipWidgetName="AlertNonServiceableZipWidget"
|
|
alertInvalidZipWidgetName="AlertInvalidZipWidget" />
|
|
<mobileLocationModalQuestion
|
|
cmsWidgetName="MobileLocationModalWidget"
|
|
modalWidgetName="LocationModalWidget"
|
|
textboxQuestionWidgetName="MobileLocationQuestionWidget" />
|
|
<funnel-footer
|
|
cmsWidgetName="FunnelFooterWidget"
|
|
:isForwardActionDisabled="!meta.valid"
|
|
@back-clicked="backButtonAction"
|
|
@ForwardClicked="forwardButtonAction" />
|
|
</div>
|
|
</Form>
|
|
</template>
|
|
|
|
<script>
|
|
// Components
|
|
import serviceZipModalQuestion from "@/layouts/service-location/service-zip-modal-question/service-zip-modal-question";
|
|
import mobileLocationModalQuestion from "@/layouts/service-location/mobile-location-modal-question/mobile-location-modal-question";
|
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
|
import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer";
|
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
|
|
|
//Supporting Files
|
|
import { Form } from "vee-validate";
|
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
|
|
|
export default {
|
|
name: "service-location",
|
|
data() {
|
|
return {};
|
|
},
|
|
async beforeRouteEnter(to, from, next) {
|
|
// Call APIs
|
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
|
|
|
// Settle promises and get results
|
|
const promiseResultMap = [
|
|
{
|
|
resultKey: "cmsContent",
|
|
promise: cmsContentPromise,
|
|
},
|
|
];
|
|
|
|
const resultMap = await settleAllPromises(promiseResultMap);
|
|
|
|
// Call the "next" function to complete the transition to this page.
|
|
next((vm) => {
|
|
vm.setCmsContent(resultMap.cmsContent);
|
|
});
|
|
},
|
|
methods: {
|
|
arePagePrerequisitesValid() {
|
|
return true;
|
|
},
|
|
|
|
backButtonAction() {},
|
|
forwardButtonAction() {},
|
|
},
|
|
components: {
|
|
serviceZipModalQuestion,
|
|
mobileLocationModalQuestion,
|
|
funnelHeader,
|
|
funnelFooter,
|
|
funnelSubHeader,
|
|
Form,
|
|
},
|
|
};
|
|
</script>
|