96 lines
3.4 KiB
Vue
96 lines
3.4 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
|
|
v-model="serviceZipQuestion"
|
|
cmsWidgetName="ServiceZipModalWidget"
|
|
textboxQuestionWidgetName="ServiceZipQuestionWidget"
|
|
alertNonServiceableZipWidgetName="AlertNonServiceableZipWidget"
|
|
alertInvalidZipWidgetName="AlertInvalidZipWidget" />
|
|
<mobileLocationModalQuestions
|
|
v-model="mobileLocationQuestions"
|
|
cmsWidgetName="MobileLocationLinkWidget"
|
|
modalWidgetName="MobileLocationModalWidget"
|
|
mobileFeeDisclaimerWidgetName="MobileFeeDisclaimerWidget"
|
|
workspaceRequirementsWidgetName="WorkspaceRequirementsWidget" />
|
|
<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 mobileLocationModalQuestions from "@/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions";
|
|
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 {
|
|
serviceZipQuestion: {
|
|
serviceState: "",
|
|
serviceZipCode: "",
|
|
},
|
|
mobileLocationQuestions: {
|
|
addressQuestions: {
|
|
streetAddress: "",
|
|
apartmentNumberOrBusinessName: "",
|
|
city: "",
|
|
state: "",
|
|
zipCode: "",
|
|
},
|
|
},
|
|
};
|
|
},
|
|
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,
|
|
mobileLocationModalQuestions,
|
|
funnelHeader,
|
|
funnelFooter,
|
|
funnelSubHeader,
|
|
Form,
|
|
},
|
|
};
|
|
</script>
|