Before merging latest from develop
This commit is contained in:
parent
025ae14047
commit
fe87962a41
6 changed files with 106 additions and 99 deletions
|
|
@ -4,7 +4,9 @@
|
||||||
:ref="inputId"
|
:ref="inputId"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
class="form-control">
|
class="form-control">
|
||||||
<option v-for="option in options" :value="option" :key="option.value">{{ option }}</option>
|
<option v-for="(value, name, index) in options" :value="name" :key="index">
|
||||||
|
{{ value }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -22,10 +24,8 @@ export default {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data(){
|
data() {
|
||||||
return {
|
|
||||||
value: String,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
selectedOption: {
|
selectedOption: {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<label :for="inputId">{{ labelText }}</label>
|
<label :for="inputId">{{ labelText }}</label>
|
||||||
<input type="text"
|
<input v-model="value" type="text"
|
||||||
:ref="inputId"
|
:ref="inputId"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
:placeholder="placeholderText"
|
:placeholder="placeholderText"
|
||||||
|
|
@ -19,8 +19,15 @@ export default {
|
||||||
placeholderText: String,
|
placeholderText: String,
|
||||||
inputId: String,
|
inputId: String,
|
||||||
},
|
},
|
||||||
setup(props) {
|
computed: {
|
||||||
|
value: {
|
||||||
|
get: function() {
|
||||||
|
return this.modelValue;
|
||||||
|
},
|
||||||
|
set: function(newValue) {
|
||||||
|
this.$emit("update:modelValue", newValue);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -26,56 +26,55 @@ import store from "@/store";
|
||||||
export default {
|
export default {
|
||||||
name: "address-lookup",
|
name: "address-lookup",
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
|
|
||||||
// Settle promises and get results
|
// Settle promises and get results
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.$refs.funnelHeader.initializeComponent(
|
vm.$refs.funnelHeader.initializeComponent(
|
||||||
resultMap.cmsContent.FunnelHeaderWidget
|
resultMap.cmsContent.FunnelHeaderWidget
|
||||||
);
|
);
|
||||||
vm.$refs.vehicleBanner.initializeComponent(
|
vm.$refs.vehicleBanner.initializeComponent(
|
||||||
resultMap.cmsContent.VehicleBannerWidget
|
resultMap.cmsContent.VehicleBannerWidget
|
||||||
);
|
);
|
||||||
vm.$refs.funnelSubHeader.initializeComponent(
|
vm.$refs.funnelSubHeader.initializeComponent(
|
||||||
resultMap.cmsContent.FunnelSubHeaderWidget
|
resultMap.cmsContent.FunnelSubHeaderWidget
|
||||||
);
|
);
|
||||||
vm.$refs.funnelFooter.initializeComponent(
|
vm.$refs.funnelFooter.initializeComponent(
|
||||||
resultMap.cmsContent.FunnelFooterWidget
|
resultMap.cmsContent.FunnelFooterWidget
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
selectedDamageLocations: [],
|
|
||||||
driverSideOptionsData: [],
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return store.getters.vehicle.carId !== null;
|
return store.getters.vehicle.carId !== null;
|
||||||
},
|
},
|
||||||
resetDependentState() {
|
resetDependentState() {
|
||||||
// Invokes
|
// Invokes
|
||||||
store.dispatch(storeActions.RESET_PARTS_AND_DEPS);
|
store.dispatch(storeActions.RESET_PARTS_AND_DEPS);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
funnelFooter,
|
funnelFooter,
|
||||||
vehicleBanner,
|
vehicleBanner,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
customerQuestions,
|
customerQuestions,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<form>
|
<form>
|
||||||
<div class="row my-4">
|
<div class="row my-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textQuestion v-model="streetAddress" ref="autocomplete" inputId="autocomplete" placeholderText="Search" labelText="Street address" />
|
<textQuestion v-model="address.streetAddress" ref="autocomplete" inputId="autocomplete" placeholderText="Search" labelText="Street address" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -19,12 +19,7 @@
|
||||||
<dropdownQuestion v-model="state" ref="state" inputId="state" :options="stateOptions" labelText="State" />
|
<dropdownQuestion v-model="state" ref="state" inputId="state" :options="stateOptions" labelText="State" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label for="zip">Zip</label>
|
<textQuestion v-model="zip" ref="zip" inputId="zip" labelText="Zip" />
|
||||||
<input ref="zip"
|
|
||||||
id="zip"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
autocomplete="off" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -55,6 +50,9 @@ export default ({
|
||||||
showAddressFields: false,
|
showAddressFields: false,
|
||||||
displayVerificationWarning: false,
|
displayVerificationWarning: false,
|
||||||
displayNoMatchWarning: false,
|
displayNoMatchWarning: false,
|
||||||
|
address: {
|
||||||
|
streetAddress: "",
|
||||||
|
},
|
||||||
streetAddress: "",
|
streetAddress: "",
|
||||||
city: "",
|
city: "",
|
||||||
state: "",
|
state: "",
|
||||||
|
|
@ -168,13 +166,9 @@ export default ({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let city = document.querySelector("#city");
|
self.city = "";
|
||||||
let state = document.querySelector("#state");
|
self.state = "";
|
||||||
let zip = document.querySelector("#zip");
|
self.zip = "";
|
||||||
|
|
||||||
city.value = "";
|
|
||||||
state.value = "";
|
|
||||||
zip.value = "";
|
|
||||||
|
|
||||||
self.displayVerificationWarning = false;
|
self.displayVerificationWarning = false;
|
||||||
self.displayNoMatchWarning = true;
|
self.displayNoMatchWarning = true;
|
||||||
|
|
@ -190,10 +184,7 @@ export default ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (place && place.address_components) {
|
if (place && place.address_components) {
|
||||||
let address1 = "";
|
self.streetAddress= "";
|
||||||
let city = document.querySelector("#city");
|
|
||||||
let state = document.querySelector("#state");
|
|
||||||
let zip = document.querySelector("#zip");
|
|
||||||
self.showAddressFields = true;
|
self.showAddressFields = true;
|
||||||
|
|
||||||
for (const component of place.address_components) {
|
for (const component of place.address_components) {
|
||||||
|
|
@ -201,15 +192,15 @@ export default ({
|
||||||
|
|
||||||
switch (componentType) {
|
switch (componentType) {
|
||||||
case "street_number": {
|
case "street_number": {
|
||||||
address1 = `${component.long_name} ${address1}`;
|
self.streetAddress = component.long_name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "route": {
|
case "route": {
|
||||||
address1 += component.short_name;
|
self.streetAddress += ' ' + component.short_name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "locality": {
|
case "locality": {
|
||||||
city.value = component.long_name;
|
self.city = component.long_name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "administrative_area_level_1": {
|
case "administrative_area_level_1": {
|
||||||
|
|
@ -217,14 +208,13 @@ export default ({
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "postal_code": {
|
case "postal_code": {
|
||||||
zip.value = component.long_name;
|
self.zip = component.long_name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addressField1.value = address1;
|
|
||||||
self.displayVerificationWarning = false;
|
self.displayVerificationWarning = false;
|
||||||
self.displayNoMatchWarning = false;
|
self.displayNoMatchWarning = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<addressQuestions />
|
<addressQuestions v-model="address" />
|
||||||
<div class="row my-4">
|
<div class="row my-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<label for="firstName">First name</label>
|
<textQuestion v-model="firstName" ref="firstName" inputId="firstName" labelText="First name" />
|
||||||
<input ref="firstName"
|
|
||||||
id="firstName"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
autocomplete="off" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row my-4">
|
<div class="row my-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<label for="lastName">Last name</label>
|
<textQuestion v-model="lastName" ref="lastName" inputId="lastName" labelText="Last name" />
|
||||||
<input ref="lastName"
|
|
||||||
id="lastName"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
autocomplete="off" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<emailQuestion />
|
<emailQuestion />
|
||||||
|
|
@ -27,6 +17,7 @@
|
||||||
<script>
|
<script>
|
||||||
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
||||||
import emailQuestion from "@/layouts/address-lookup/customer-questions/email-question/email-question";
|
import emailQuestion from "@/layouts/address-lookup/customer-questions/email-question/email-question";
|
||||||
|
import textQuestion from "@/common-components/text-question/text-question";
|
||||||
|
|
||||||
//import store from "@/store";
|
//import store from "@/store";
|
||||||
|
|
||||||
|
|
@ -34,24 +25,32 @@ export default ({
|
||||||
name: "customer-questions",
|
name: "customer-questions",
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
address: {
|
||||||
|
streetAddress: "",
|
||||||
|
},
|
||||||
|
firstName: "",
|
||||||
|
lastName: "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
|
||||||
modelValue: Array,
|
|
||||||
groupName: String,
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
initializeComponent(cmsContent, damageOptions){
|
initializeComponent(cmsContent, damageOptions){
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
value: {
|
||||||
|
get: function() {
|
||||||
|
return this.modelValue;
|
||||||
|
},
|
||||||
|
set: function(newValue) {
|
||||||
|
this.$emit("update:modelValue", newValue);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
addressQuestions,
|
addressQuestions,
|
||||||
emailQuestion,
|
emailQuestion,
|
||||||
|
textQuestion,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,12 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="row my-4">
|
<div class="row my-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<label for="email">Email address</label>
|
<textQuestion v-model="email" ref="email" inputId="email" labelText="Email address" />
|
||||||
<input ref="email"
|
|
||||||
id="email"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
autocomplete="off" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import textQuestion from "@/common-components/text-question/text-question";
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
|
export default ({
|
||||||
|
name: "emailQuestion",
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
email: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
textQuestion,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
Reference in a new issue