diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue
index 9602daadb..927af3ba7 100644
--- a/src/digital-components/textbox-question/textbox-question.vue
+++ b/src/digital-components/textbox-question/textbox-question.vue
@@ -50,6 +50,7 @@
:autocomplete="autocomplete" />
@@ -185,6 +186,7 @@ export default {
// Focus cursor in input when search icon is clicked
const field = document.querySelector("input");
field.focus();
+ this.$emit("search-icon-click");
},
async imageChanged(e) {
let file = e.target.files[0];
@@ -263,6 +265,10 @@ export default {
.input-wrapper {
position: relative;
&.has-search-icon {
+ .form-control {
+ border-radius: 48px;
+ padding-left: 1.5rem;
+ }
button[type="submit"] {
position: absolute;
top: 50%;
@@ -271,10 +277,11 @@ export default {
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.7817 14.7328L11.8252 10.7762C12.8833 9.45005 13.3936 7.76911 13.2513 6.07849C13.1091 4.38788 12.325 2.81587 11.0601 1.6852C9.79515 0.554524 8.14538 -0.0490261 6.44946 -0.00154744C4.75353 0.0459312 3.14012 0.740836 1.94045 1.94051C0.740775 3.14018 0.0458701 4.75359 -0.00160848 6.44952C-0.0490871 8.14545 0.554463 9.79521 1.68514 11.0601C2.81581 12.325 4.38782 13.1091 6.07843 13.2514C7.76905 13.3937 9.44999 12.8834 10.7762 11.8252L14.7349 15.7839C14.8044 15.8527 14.8869 15.907 14.9774 15.9439C15.068 15.9808 15.165 15.9995 15.2628 15.9989C15.3606 15.9983 15.4573 15.9784 15.5475 15.9405C15.6376 15.9025 15.7194 15.8471 15.7881 15.7776C15.8568 15.708 15.9112 15.6256 15.9481 15.535C15.985 15.4444 16.0036 15.3474 16.0031 15.2496C16.0025 15.1518 15.9826 15.0551 15.9446 14.965C15.9067 14.8748 15.8513 14.7931 15.7817 14.7243V14.7328ZM6.63737 11.7913C5.61803 11.7913 4.62157 11.4891 3.77402 10.9228C2.92646 10.3564 2.26587 9.5515 1.87578 8.60975C1.4857 7.668 1.38363 6.63172 1.5825 5.63196C1.78136 4.6322 2.27222 3.71386 2.99301 2.99307C3.7138 2.27229 4.63214 1.78142 5.6319 1.58256C6.63166 1.38369 7.66793 1.48576 8.60969 1.87585C9.55144 2.26593 10.3564 2.92652 10.9227 3.77408C11.489 4.62163 11.7913 5.61809 11.7913 6.63743C11.7896 8.00382 11.2461 9.31376 10.2799 10.2799C9.3137 11.2461 8.00376 11.7897 6.63737 11.7913Z' fill='%231574A1'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-position: center;
- background-color: transparent;
+ //background-color: transparent;
width: 2.75rem;
height: 100%;
border: none;
+ border-radius: 0 48px 48px 0;
display: flex;
&:hover {
cursor: default;
@@ -351,6 +358,7 @@ export default {
&:hover {
box-shadow: 0 0 0 4px transparent;
border: 1px solid $gray-500;
+ //border-radius: 48px;
}
}
&:hover {
@@ -362,4 +370,14 @@ export default {
display: none;
}
}
+.search-icon-button {
+ background-color: #e5f1fa;
+}
+.search-icon-button:hover,
+.search-icon-button:focus {
+ border: 1px solid $gray-500;
+ box-shadow: 0 0 0 4px $blue-300;
+ background-color: #e5f1fa; // keep the background on hover
+ outline: none;
+}
diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue
index f9787a0e0..0d7aa9e24 100644
--- a/src/layouts/service-location/service-location.vue
+++ b/src/layouts/service-location/service-location.vue
@@ -23,6 +23,7 @@
@updated-serviceability="setServiceabilityDetails"
@updated-contains-military-base="setContainsMilitaryBase"
@updated-bill-to-account-number="setBillToAccountNumber"
+ @updated-zipcode-ctu="setZipcodeCtu"
linkWidgetName="ServiceZipLinkWidget"
modalWidgetName="ServiceZipModalWidget" />
@@ -107,25 +108,36 @@
@setMobileLocation="setMobileLocationQuestions"
@set-mobile-location-invalid="setMobileLocationInValid" />
-
-
-
+
@@ -151,6 +163,9 @@ import mobileLocationModalQuestions from "@/layouts/service-location/mobile-loca
import appointmentTypeQuestion from "@/layouts/service-location/appointment-type-question/appointment-type-question";
import shopQuestion from "@/layouts/service-location/shop-question/shop-question";
import shopQuestionPopup from "@/layouts/service-location/shop-question/shop-question-popup";
+import buttonQuestion from "@/digital-components/button-question/button-question.vue";
+import shopListButton from "@/layouts/service-location/shop-question/shop-list-button/shop-list-button";
+import { getAvailabilityRating } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
import navbar from "@/fmg-components/nav-bar/nav-bar";
@@ -236,6 +251,7 @@ export default {
shopProviderData: null,
navigatingForward: false,
isMobileAddressValid: true,
+ shopListButton: shopListButton,
};
},
async beforeRouteEnter(to, from, next) {
@@ -443,6 +459,54 @@ export default {
isForwardActionDisabled() {
return this.displayNoShopsAlert || !this.isMobileAddressValid;
},
+ additionalButtonData() {
+ const startDate = new Date();
+ const endDate = new Date();
+ endDate.setDate(startDate.getDate() + 6);
+
+ const formattedStartDate = startDate.toISOString().split("T")[0];
+ const formattedEndDate = endDate.toISOString().split("T")[0];
+
+ return {
+ availabilityRatingCallback: getAvailabilityRating,
+ startDate: formattedStartDate,
+ endDate: formattedEndDate,
+ shopAppointmentType: this.selectedAppointmentType,
+ };
+ },
+ selectedShopAnswer() {
+ const toTitleCase = (str) => {
+ if (!str) return "";
+ return str.replace(/\w\S*/g, function (txt) {
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
+ });
+ };
+
+ if (this.selectedProvider && this.selectedProvider.address) {
+ const provider = this.shopProviderData?.shopProviders?.find(
+ (p) => p.providerNumber === this.selectedProvider?.providerNumber
+ );
+ const streetAddress = toTitleCase(this.selectedProvider.address.streetAddress);
+ const city = toTitleCase(this.selectedProvider.address.city);
+ const state = this.selectedProvider.address.state;
+ const zipCode = this.selectedProvider.address.zipCode;
+ const distanceInMiles = provider ? Math.round(provider.distanceInMiles * 2) / 2 : 0;
+
+ return [
+ {
+ buttonLabel: `${city}`,
+ buttonLabelSubCopy: `${distanceInMiles} mi`,
+ buttonBodyCopy: `${streetAddress}, ${city}, ${state} ${zipCode}`,
+ //additionalButtonData: this.additionalButtonData,
+ value: this.selectedProvider.providerNumber,
+ },
+ ];
+ }
+ return [];
+ },
+ questionText() {
+ return this.getCmsContent("YourSafeliteShopWidget", "QuestionText");
+ },
},
methods: {
arePagePrerequisitesValid() {
@@ -726,8 +790,6 @@ export default {
this.selectedProvider.address.zipCode = null;
this.selectedProvider.address.zipCodeCtu = null;
} else {
- // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they
- // may have selected a shop in a different ctu. change the servicelocation zip/ctu if different
if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) {
ctu = this.selectedProvider.address.zipCodeCtu;
}
@@ -777,12 +839,59 @@ export default {
setMobileLocationInValid(isMobileLocationInValid) {
this.isMobileAddressValid = !isMobileLocationInValid;
},
- onShopSelected(providerNumber) {
- // Find the provider object from your shopProviderData
- const selectedProvider = this.shopProviderData.shopProviders.find(
- (p) => p.providerNumber === providerNumber
+ onShopSelected(providerObject) {
+ const current = this.shopProviderData?.shopProviders?.find(
+ (p) => p.providerNumber === this.selectedProvider?.providerNumber
);
- this.selectedProvider = selectedProvider;
+ if (current) {
+ this.selectedProvider = current;
+ }
+
+ let provider = this.shopProviderData?.shopProviders?.find(
+ (p) => p.providerNumber === providerObject?.providerNumber
+ );
+ if (!provider && this.shopProviderData?.shopProviders?.length > 0) {
+ provider = this.shopProviderData.shopProviders[0];
+ }
+ this.selectedProvider = provider;
+ if (provider && provider.address) {
+ this.zipCode = provider.address.zipCode;
+ this.state = provider.address.state;
+ }
+ if (
+ !this.selectedProvider ||
+ !this.shopProviderData?.shopProviders?.some(
+ (p) => p.providerNumber === this.selectedProvider?.providerNumber
+ )
+ ) {
+ this.selectedProvider = this.shopProviderData?.shopProviders?.[0];
+ }
+ if (providerObject && providerObject.address) {
+ this.zipCode = providerObject.address.zipCode;
+ this.state = providerObject.address.state;
+ }
+ },
+ setZipcodeCtu(zipcodeCtu) {
+ this.zipCodeCtu = zipcodeCtu;
+ },
+ onShopModelUpdated(newModel) {
+ if (newModel.zipCode) {
+ this.zipCode = newModel.zipCode;
+ }
+ if (newModel.zipCodeCtu) {
+ this.zipCodeCtu = newModel.zipCodeCtu;
+ }
+ if (newModel.state) {
+ this.state = newModel.state;
+ }
+ if (this.shopProviderData && newModel.selectedProviderNumber) {
+ const provider = this.shopProviderData.shopProviders.find(
+ (p) => p.providerNumber === newModel.selectedProviderNumber
+ );
+ if (provider) {
+ this.selectedProvider = provider;
+ }
+ }
},
},
watch: {
@@ -796,7 +905,7 @@ export default {
this.shopProviderData.mobileProviderNumber
);
} else {
- this.selectedProvider = new Provider();
+ this.isMobileAddressValid = true;
}
});
}
@@ -819,7 +928,7 @@ export default {
}
this.$refs.mobileLocationQuestions.resetAlerts();
} else {
- this.selectedProvider = new Provider();
+ this.selectedProvider = this.shopProviderData.shopProviders[0];
}
},
},
@@ -835,8 +944,8 @@ export default {
Form,
loadingModal,
contentGroupModal,
- //shopQuestion,
shopQuestionPopup,
+ buttonQuestion,
},
};
@@ -861,4 +970,8 @@ export default {
color: $black;
}
}
+.shop-question-button .list-button-content {
+ background: #e4f1f7 !important;
+ box-shadow: 0 0 0 1px $primary !important;
+}
diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue
index a0a43dc14..8fe355923 100644
--- a/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue
+++ b/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue
@@ -7,6 +7,8 @@
questionAlignment="center"
cornerStyle="rounded"
mask="#####"
+ :includeSearchIcon="includeSearchIcon"
+ @search-icon-click="$emit('search-icon-click')"
:displayQuestionText="false"
:isRequired="isRequired"
:validationRules="computedValidationRules" />
@@ -35,6 +37,10 @@ export default {
type: Boolean,
default: true,
},
+ includeSearchIcon: {
+ type: Boolean,
+ default: false,
+ },
},
computed: {
value: {
diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue
index c3ea91faf..8da980863 100644
--- a/src/layouts/service-location/shop-question/shop-question-popup.vue
+++ b/src/layouts/service-location/shop-question/shop-question-popup.vue
@@ -8,29 +8,6 @@
cmsWidgetName="AlertDropoffInformationWidget"
alertClass="alert-info"
v-bind:isDismissible="false" />
-
-
-
+ @footer-button-event="SetZipCodeAndShop">
+
-
-
+
+
+