From 3a27911c799d1127d42123c7ec3d3ff452767e09 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Mon, 9 Oct 2023 16:30:51 +0530 Subject: [PATCH] Update confirmation.vue replace #YMM #Email with global state and #ADDRESS @MYACCOUNT url with custom state --- src/layouts/confirmation/confirmation.vue | 107 ++++++++++------------ 1 file changed, 50 insertions(+), 57 deletions(-) diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 059c09230..37e0e8098 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -16,8 +16,8 @@ :displayGenericVehicleImage="false" />
-

{{ this.getScheduleDate() }}

-

{{ this.getScheduleTime() }}

+

{{ this.ScheduleDateFormatted }}

+

{{ this.ScheduleTimeFormatted }}

@@ -34,11 +34,9 @@
-
+
-
+
"); }, ScheduleDate() { return store.getters.order.schedule.date; @@ -148,17 +149,50 @@ export default { ProviderZipCode() { return store.getters.order.serviceLocation.provider.address.zipCode; }, - Year() { - return store.getters.order.vehicle.year; + AppointmentWordingText() { + if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { + return this.MobileWordingText.replaceAll( + "{custom:ADDRESS}", + this.ServiceLocationFullAddress + ); + } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { + return this.DropOffWordingText.replaceAll( + "{custom:ADDRESS}", + this.ProviderFullAddress + ); + } else { + return this.InShopWordingText.replaceAll( + "{custom:ADDRESS}", + this.ProviderFullAddress + ); + } }, - Make() { - return store.getters.order.vehicle.make; + ServiceLocationFullAddress() { + return `${this.ServiceLocationAddress2 ? this.ServiceLocationAddress2 + "," : ""} ${ + this.ServiceLocationAddress + },
${this.ServiceLocationCity}, ${this.ServiceLocationState} ${ + this.ServiceLocationZipCode + }`; }, - Model() { - return store.getters.order.vehicle.model; + ProviderFullAddress() { + return `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; }, - Email() { - return store.getters.order.customer.emailAddress; + ScheduleDateFormatted() { + const scheduleDate = new Date(this.ScheduleDate); + return `${getFullDayName(scheduleDate)}, ${getFullMonthName( + scheduleDate + )} ${scheduleDate.getDate()}`; + }, + ScheduleTimeFormatted() { + if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { + return `Between ${get12HourTimeMobileFormat( + this.ScheduleStartTime + )} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`; + } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { + return `Drop off before 9:30 AM`; + } else { + return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`; + } }, }, methods: { @@ -187,54 +221,13 @@ export default { // Schedule const schedule = store.getters.order.schedule; - const scheduleReqs = !!(schedule.date && schedule.startTime); //removing schedule.endTime for testing + const scheduleReqs = !!(schedule.date && schedule.startTime && schedule.endTime); return serviceLocationReqs && scheduleReqs; }, forwardButtonAction() { window.location.assign("//www.safelite.com/"); }, - getScheduleDate() { - const scheduleDate = new Date(this.ScheduleDate); - return `${getFullDayName(scheduleDate)}, ${getFullMonthName( - scheduleDate - )} ${scheduleDate.getDate()}`; - }, - getScheduleTime() { - if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { - return `Between ${get12HourTimeMobileFormat( - this.ScheduleStartTime - )} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`; - } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { - return `Drop off before 9:30 AM`; - } else { - return `at ${get12HourTimeFormat(this.ScheduleStartTime)}`; - } - }, - - getAppointmentWordingText() { - const ymm = `${this.Year} ${this.Make} ${this.Model}`; - if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { - const address = `${ - this.ServiceLocationAddress2 ? this.ServiceLocationAddress2 + "," : "" - } ${this.ServiceLocationAddress},
${this.ServiceLocationCity}, ${ - this.ServiceLocationState - } ${this.ServiceLocationZipCode}`; - return this.MobileWordingText.replace("#ADDRESS", address).replace("#YMM", ymm); - } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { - const address = `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; - return this.DropOffWordingText.replace("#ADDRESS", address).replace("#YMM", ymm); - } else { - const address = `${this.ProviderAddress},
${this.ProviderCity}, ${this.ProviderState} ${this.ProviderZipCode}`; - return this.InShopWordingText.replace("#ADDRESS", address).replace("#YMM", ymm); - } - }, - getConfirmationEmailText() { - return this.ConfirmationEmailText.replace("#EMAIL", this.Email) - .replace("#MY_ACCOUNT_URL", applicationConfig.MY_ACCOUNT) - .replace(/</g, "<") - .replace(/>/g, ">"); - }, }, components: { funnelHeader,