diff --git a/public/css/hop-styling.css b/public/css/hop-styling.css index 66d1b1aa..f6d8b552 100644 --- a/public/css/hop-styling.css +++ b/public/css/hop-styling.css @@ -32,6 +32,7 @@ body span { body a { color: #0070D1; text-decoration: none; + font-weight: 500; } body a:hover { text-decoration: underline; @@ -175,13 +176,18 @@ body .has-error select { border-color: #db0020; } body .has-error select { - background: url(/icons/select-error.png) no-repeat 98% #ffffff; - background-size: 10px 17px; - appearance: none; + background-image: url(/icons/select-error.png); } body .has-error small { - margin-top: 4px; - color: #d4281c; + margin-bottom: 0.3125rem; + color: #db0020; +} +body .has-success input, +body .has-success select { + border-color: #0c7e47; +} +body .has-success select { + background-image: url(/icons/select-error.png); } body .cc-error-container #alert-message { background-color: #fcbfbb; diff --git a/public/css/site-2020Styling.css b/public/css/site-2020Styling.css index ae2f004f..7327505d 100644 --- a/public/css/site-2020Styling.css +++ b/public/css/site-2020Styling.css @@ -88,7 +88,7 @@ } .buy-backdrop { - background-color: rgba(0, 0, 0, 0.3) !important; + background-color: rgba(0, 0, 0, 0.8) !important; } .buy-backdrop #afterpay__iframe-checkout-container { width: 100%; @@ -97,10 +97,6 @@ display: none; } -.buy-container-closer { - display: none; -} - @keyframes rotate { 0% { transform: rotate(0); diff --git a/public/scss/hop-styling.scss b/public/scss/hop-styling.scss index 6e2c274a..2bc6a195 100644 --- a/public/scss/hop-styling.scss +++ b/public/scss/hop-styling.scss @@ -36,6 +36,7 @@ body { a { color: #0070D1; text-decoration: none; + font-weight: 500; &:hover { text-decoration: underline; color: #167cac; @@ -200,13 +201,22 @@ body { border-color: #db0020; } select { - background: url(/icons/select-error.png) no-repeat 98% #ffffff;; - background-size: 10px 17px; - appearance: none; + background-image: url(/icons/select-error.png); } small { - margin-top: 4px; - color: #d4281c; + margin-bottom: .3125rem; + color: #db0020; + } + } + + + .has-success { + input, + select { + border-color: #0c7e47; + } + select { + background-image: url(/icons/select-error.png); } } diff --git a/public/scss/site-2020Styling.scss b/public/scss/site-2020Styling.scss index 14cd2c28..6ddde5dc 100644 --- a/public/scss/site-2020Styling.scss +++ b/public/scss/site-2020Styling.scss @@ -93,7 +93,7 @@ // AfterPay Styles .buy-backdrop { - background-color: rgba(0,0,0,.3)!important; + background-color: rgba(0,0,0,.8)!important; #afterpay__iframe-checkout-container { width: 100%; .style_closeWrapper__lIHJe { @@ -102,10 +102,6 @@ } } -.buy-container-closer { - display: none; -} - // Modal Spinner @keyframes rotate { diff --git a/src/layouts/payment-page/payment-page.vue b/src/layouts/payment-page/payment-page.vue index 4fc81d7b..04b7bb9a 100644 --- a/src/layouts/payment-page/payment-page.vue +++ b/src/layouts/payment-page/payment-page.vue @@ -10,18 +10,22 @@
-
+
+
{{ cartTitle }}
+
+ +
+
+
{{ switchPaymentText }}
+ +
@@ -409,6 +439,9 @@ import cartDropdown from '@/iss-components/cart-dropdown/cart-dropdown.vue'; import { formatAmountInDollars } from '@/helpers/text-helper'; import showIssLoadingModal from '@/helpers/loading-modal-helper'; import { supportsApplePay } from '@/helpers/browser-helper'; +import buttonMain from '@/ux-components/button-main/button-main.vue'; +import { submitWorkOrder } from '@/helpers/order-helper'; +import submitType from '@/constants/submit-type'; export default { name: 'payment-page', @@ -417,7 +450,8 @@ export default { siteHeader, siteFooter, Form, - alert + alert, + buttonMain }, directives: { resize: { @@ -434,7 +468,8 @@ export default { mixins: [BaseFormMixin], async beforeRouteEnter(to, from, next) { const paymentType = useMainStore().order.payment.paymentMethod; - if (paymentType === paymentMethods.PAYPAL) { + const alertToDisplay = to.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT]; + if (paymentType === paymentMethods.PAYPAL || alertToDisplay) { useMainStore().savePaymentMethodChoice(paymentMethods.CREDIT_CARD); } @@ -499,7 +534,8 @@ export default { totalAmount: this.getAmountDue(), displayAmount: this.getDisplayAmountDue(), payInAdvanceLineItems: '', - shouldBlockInteraction: false + shouldBlockInteraction: false, + afterpayModalOpen: false }; }, computed: { @@ -537,6 +573,21 @@ export default { } return ''; }, + cartTitle() { + return this.getCmsContent('OrderSummaryTextWidget', widgetFields.TEXT_BLOCK_WIDGET.TEXT); + }, + switchPaymentText() { + return this.getCmsContent('SwitchPaymentTextWidget', widgetFields.TEXT_BLOCK_WIDGET.TEXT); + }, + submitPaymentText() { + return this.getCmsContent('SiteFooterWidget', widgetFields.FOOTER_WIDGET.FORWARD_BUTTON_TEXT); + }, + afterpayButtonText() { + return this.getCmsContent('AfterpayButtonWidget', widgetFields.CONTENT_GROUP_WIDGET.HEADER_TEXT); + }, + afterpayLogo() { + return this.getCmsContent('AfterpayButtonWidget', widgetFields.CONTENT_GROUP_WIDGET.IMAGE); + }, isPaypal() { return this.paymentType === paymentMethods.PAYPAL; }, @@ -720,6 +771,7 @@ export default { } if (this.isAfterPay) { + this.afterpayModalOpen = true; iframe.contentWindow.postMessage('afterpay', '*'); } else { iframe.contentWindow.postMessage('CreditCardChosen', '*'); @@ -730,12 +782,19 @@ export default { }); }, handleIFrameContentWindowMessage(event) { + console.log('Received message from iframe:', event.data); + const iframe = this.$refs.paymentFrame; if (typeof event.data !== 'string') { return; } if (event.data.includes('afterpayClosed')) { - this.backButtonAction(); + if (this.isAfterPay) { + this.backButtonAction(); + } else { + iframe.contentWindow.postMessage('CreditCardChosen', '*'); + this.afterpayModalOpen = false; + } } if (useMainStore().order.payment.paymentMethod !== paymentMethods.PayNow) { @@ -776,7 +835,10 @@ export default { this.$route.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT] === payMethod ); }, - paymentFailedPayLater() { + async paymentFailedPayLater() { + this.showIssLoadingModal(true); + this.mainStore.savePaymentMethodChoice(paymentMethods.PAY_AT_TIME_OF_SERVICE); + await submitWorkOrder({ submitType: submitType.SAFELITE }); this.$router.navigate( this.navigationScenarios.CLICKED_FORWARD, this.$route @@ -792,6 +854,15 @@ export default { this.$route ); }, + submitPaymentAction() { + const iframe = this.$refs.paymentFrame; + iframe.contentWindow.postMessage('submitPayment', '*'); + }, + switchToAfterPay() { + const iframe = this.$refs.paymentFrame; + this.afterpayModalOpen = true; + iframe.contentWindow.postMessage('afterpay-switch', '*'); + }, showIssLoadingModal } }; @@ -808,8 +879,66 @@ export default { } } + .order-summary-panel { + margin-bottom: 1.375rem; + } + + .cart-title { + font-size: 1rem; + font-weight: 500; + margin-top: 1.25rem; + margin-bottom: .625rem; + } + + .cart-dropdown-component:deep(*) { + font-size: .8125rem; + } + + .submit-payment-button { + width: 100%; + font-weight: $font-weight-normal; + } + + .switch-payment-container { + padding-top: 1.25rem + } + + .switch-payment-text { + padding-top: 1rem; + padding-bottom: .625rem; + border-top: 1px solid #f0f1f2 + } + .footer-component:deep(.footer) { - margin: 0; + margin: 1.25rem 0 0 0; + } + + .afterpay-button { + width: 100%; + height: 2.875rem; + border: solid 1px #cacbcc; + border-radius: 1.375rem; + background-color: white; + box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.2); + color: $darker-gray; + font-weight: 400; + margin-bottom: 1.25rem; + padding: .5rem 1rem; + + &:focus { + background: $background-color-selected; + } + &:active { + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + } + } + + .pay-in-advance-alert { + width: 80%; + + @media (max-width: 35rem) { + width: 100%; + } } } diff --git a/src/ux-components/alert/alert.vue b/src/ux-components/alert/alert.vue index 0e0ea2be..6b5ec5c5 100644 --- a/src/ux-components/alert/alert.vue +++ b/src/ux-components/alert/alert.vue @@ -106,6 +106,7 @@ :text="getRouterLinkDisplayTextFromCopy(copy)" href="#!" :data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)" + :preventDefaultOnClick="preventDefaultOnClick" @clickEvent="$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))" />