@@ -78,7 +93,6 @@ import { applicationConfig } from "@/constants/application-config.js";
import { defineRule } from "vee-validate";
import { required, regex } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
-import { fill } from "lodash";
// DEFINE VALIDATION RULES
defineRule("street-address-required", required(errorMessages.STREET_ADDRESS_REQUIRED));
@@ -95,12 +109,17 @@ export default {
type: Object,
default: () => ({
streetAddress: "",
+ apartmentNumberOrBusinessName: "",
city: "",
state: "",
zipCode: "",
}),
},
validationRules: String,
+ captureApartmentNumberOrBusinessName: {
+ type: Boolean,
+ default: false,
+ },
},
data() {
return {
@@ -180,6 +199,11 @@ export default {
this.$emit("update:modelValue", newValue);
},
},
+ showApartmentNumberOrBusinessNameField: {
+ get: function () {
+ return this.captureApartmentNumberOrBusinessName;
+ },
+ },
},
methods: {
setupAddressLookup() {
@@ -233,13 +257,17 @@ export default {
});
addressField1.addEventListener("keydown", (e) => {
- if (e.code === "Enter" || e.code === "NumpadEnter") {
+ const autocomplete = document.getElementById("autocomplete");
+ const event = new Event("place_changed");
+
+ if (e.code === "Enter" || e.code === "NumpadEnter" || e.code === "Tab") {
const selectedItem = document.querySelector(
".pac-container .pac-item-selected"
);
if (selectedItem !== null) {
// Fill-in the address using selected item in the list.
- fillInAddress(selectedItem);
+ autocomplete.dispatchEvent(event);
+ //fillInAddress(selectedItem.textContent);
} else {
// Fill-in the address using first item in the list.
fillInAddressUsingFirstItem();
@@ -249,23 +277,25 @@ export default {
}
});
- addressField1.addEventListener("change", () => {
- // If a match has been previously attempted then do nothing
- if (self.matchFound !== null) {
- return;
- }
+ // addressField1.addEventListener("change", () => {
+ // // If a match has been previously attempted then do nothing
+ // if (self.matchFound !== null) {
+ // return;
+ // }
- // Get the address that the user clicked on (if any)
- const clickedAddress = document.querySelector(
- ".pac-container .pac-item:hover"
- );
+ // // Get the address that the user clicked on (if any)
+ // const clickedAddress = document.querySelector(
+ // ".pac-container .pac-item:hover"
+ // );
- // If the Street Address field changed without clicking (i.e. by pressing Tab, or clicking outside the field)
- if (clickedAddress === null) {
- // Fill-in the address using first item in the list.
- fillInAddressUsingFirstItem();
- }
- });
+ // // If the Street Address field changed without clicking (i.e. by pressing Tab, or clicking outside the field)
+ // if (clickedAddress === null) {
+ // // Fill-in the address using first item in the list.
+ // fillInAddressUsingFirstItem();
+ // }
+
+ // console.log("change");
+ // });
function fillInAddressUsingFirstItem() {
// Fill-in the address using first item in the list.
@@ -290,6 +320,7 @@ export default {
}
function fillInAddress(place) {
+ console.log("fillInAddress");
if (!place) {
place = autocomplete.getPlace();
}
@@ -297,8 +328,11 @@ export default {
if (place && place.address_components) {
self.matchFound = true;
- self.addressModel.streetAddress = "";
self.$nextTick(function () {
+ //self.addressModel.streetAddress = "";
+
+ //self.$nextTick();
+
self.showAddressFields = true;
for (const component of place.address_components) {
@@ -382,6 +416,11 @@ export default {
}
},
},
+ "addressModel.streetAddress": {
+ handler(newValue, oldValue) {
+ console.log(`I got changed from ${oldValue} to ${newValue}`);
+ },
+ },
},
components: {
textboxQuestion,
diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue
new file mode 100644
index 000000000..7aea041e9
--- /dev/null
+++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue b/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue
new file mode 100644
index 000000000..b8c795d5f
--- /dev/null
+++ b/src/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue
index 872c8f4c0..a34875dbb 100644
--- a/src/layouts/service-location/service-location.vue
+++ b/src/layouts/service-location/service-location.vue
@@ -9,6 +9,11 @@ fmg
textboxQuestionWidgetName="ServiceZipQuestionWidget"
alertNonServiceableZipWidgetName="AlertNonServiceableZipWidget"
alertInvalidZipWidgetName="AlertInvalidZipWidget" />
+
// 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";
@@ -33,7 +39,17 @@ import { settleAllPromises } from "@/helpers/layout-helper";
export default {
name: "service-location",
data() {
- return {};
+ return {
+ mobileLocationQuestion: {
+ addressQuestions: {
+ streetAddress: "",
+ apartmentNumberOrBusinessName: "",
+ city: "",
+ state: "",
+ zipCode: "",
+ },
+ },
+ };
},
async beforeRouteEnter(to, from, next) {
// Call APIs
@@ -64,6 +80,7 @@ export default {
},
components: {
serviceZipModalQuestion,
+ mobileLocationModalQuestions,
funnelHeader,
funnelFooter,
funnelSubHeader,