Updates for Mobile

This commit is contained in:
Bill Richardson 2026-02-05 17:11:20 -05:00
parent c9b33a28b6
commit 54f66b43cf
4 changed files with 28 additions and 9 deletions

View file

@ -559,6 +559,7 @@ export default {
this.selectTimeSlotForDay(timeSlot);
},
async setCalendarData(config = {}) {
// set selectable dates data
config.initialShopTimeSlotsResponse.days.forEach((selectableDate) => {
const dateObjectToPush = {
date: selectableDate.date,

View file

@ -224,6 +224,8 @@ export default {
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
const storeServiceLocation = useMainStore().order.serviceLocation;
const storeSelectedAppointmentType = storeServiceLocation?.appointmentType;
const isMobileAppointment = storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE
|| storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
const storeSelectedProvider = storeServiceLocation?.provider;
const serviceZipCode = storeServiceLocation?.zipCode || useMainStore().order.customer.address.zipCode;
const zipCodeData = getZipCodeData(serviceZipCode);
@ -275,6 +277,9 @@ export default {
// use resultMap to populate layout content.
const resultMap = await settleAllPromises(promiseResultMap);
const serviceLocationData = {
defaultMobileZipCode: isMobileAppointment
? storeServiceLocation?.zipCode
: '',
glassFees: resultMap.glassFees,
mobileFeePart: resultMap.mobileFeePart,
providers: resultMap.providers,
@ -285,8 +290,6 @@ export default {
next(async (vm) => {
const providerToUse = resultMap.providers?.shopProviders
.find((provider) => provider.providerNumber === storeSelectedProvider?.providerNumber) || resultMap.providers?.shopProviders[0];
const isMobileAppointment = storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE
|| storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
const initialServiceLocationObj = {
mobileProviderNumber: isMobileAppointment
? storeSelectedProvider?.providerNumber
@ -314,10 +317,10 @@ export default {
mobileFeePart: null,
mobilePremiumAppointmentFee: null,
mobileProviderNumber: null,
mobileZipCodeOverride: null,
selectableDatesData: [],
selectedAppointmentType: this.getAppointmentType(),
selectedDate: this.getSelectedDate(),
selectedMobileZipCode: null,
selectedProvider: this.getSelectedProvider(),
selectedServiceLocation: this.getServiceLocation(),
selectedServiceLocationCity: this.getServiceLocationCity(),
@ -401,6 +404,7 @@ export default {
});
} else {
this.mobileProviderNumber = initialServiceLocationObj.mobileProviderNumber;
this.selectedMobileZipCode = initialServiceLocationObj.zipCode;
await this.getDatePickerInitialData().then((initialData) => {
this.selectableDatesData = initialData.initialShopTimeSlotsResponse;
this.$refs.datePicker.setCalendarData(initialData);
@ -430,11 +434,18 @@ export default {
return this.mainStore.order?.serviceLocation?.appointmentType;
},
async getAvailableDatesMethod(startDate, endDate) {
let mobileProviderNumberToUse = this.mobileProviderNumber;
if (this.selectedAppointmentType === AppointmentTypeStrings.MOBILE
|| this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) {
mobileProviderNumberToUse = this.selectedServiceLocation.mobileProviderNumber;
}
const newShopTimeSlots = await getAvailableDates(
startDate,
endDate,
this.selectedAppointmentType,
this.selectedProvider.providerNumber
this.selectedProvider.providerNumber || mobileProviderNumberToUse,
this.selectedMobileZipCode
);
// ADD API CALL RESULTS TO EXISTING DATE DATA
this.selectableDatesData.days =
@ -593,6 +604,7 @@ export default {
mobileZipUpdatedFromServiceLocation(mobileZipServiceLocation) {
if (mobileZipServiceLocation) {
this.mobileProviderNumber = mobileZipServiceLocation.mobileProviderNumber;
this.selectedMobileZipCode = mobileZipServiceLocation.zipCode;
this.selectedServiceLocation = mobileZipServiceLocation;
if (mobileZipServiceLocation.refreshDatePicker) {

View file

@ -171,6 +171,7 @@ export default {
city: this.getServiceCityFromStore(),
state: this.getServiceStateFromStore(),
zipCode: this.getServiceZipCodeFromStore(),
initializingData: false,
isGlassServiceableInshop: null,
isRecalibrationServiceableInshop: null,
isGlassServiceableMobile: null,
@ -289,7 +290,7 @@ export default {
}
},
async mobileZipCode(newZip, oldZip) {
if (newZip !== '' && newZip !== oldZip) {
if (newZip !== '' && newZip !== oldZip && !this.initializingData) {
showIssLoadingModal(true);
await this.updateMobileZip();
const updateMobileZipServiceLocationObj = {
@ -348,8 +349,10 @@ export default {
}
},
methods: {
initializeComponent(initialData) {
this.setData(initialData);
async initializeComponent(initialData) {
this.initializingData = true;
await this.setData(initialData);
this.initializingData = false;
},
async forwardButtonAction() {
let provider = this.selectedProvider;
@ -447,7 +450,11 @@ export default {
setCtuForMobile(val) {
this.zipCodeCtu = val;
},
setData(initialData) {
async setData(initialData) {
if (initialData.defaultMobileZipCode) {
this.mobileZipCode = initialData.defaultMobileZipCode;
}
if (initialData.zipCodeData) {
this.zipContainsMilitaryBase = initialData.zipCodeData.containsMilitaryBase;
this.zipCodeCtu = initialData.zipCodeData.zipCodeCtu;

View file

@ -509,7 +509,6 @@ form {
:deep(.input-wrapper) {
input[type="date"]::-webkit-calendar-picker-indicator {
background-color: $svg-calendar-error-fill-color;
// eslint-disable-next-line max-len
background-image: url($svg-error-calendar-graphic);
}
}