From 98b612252c66d03a0d252112dfb5cc5c4dbca4bf Mon Sep 17 00:00:00 2001 From: WillSimao Date: Sat, 17 Dec 2022 14:07:27 -0300 Subject: [PATCH] feat(MeuCarrinho): Estiliza Meu Carrinho --- .../src/arquivos/js/components/CheckoutUI.js | 3 +- checkout/src/arquivos/js/components/Footer.js | 49 +++++- .../sass/checkout/_checkout-carrinho.scss | 150 +++++++++++------- .../src/arquivos/sass/utils/_variaveis.scss | 3 +- 4 files changed, 140 insertions(+), 65 deletions(-) diff --git a/checkout/src/arquivos/js/components/CheckoutUI.js b/checkout/src/arquivos/js/components/CheckoutUI.js index 0d09908..a31cc14 100644 --- a/checkout/src/arquivos/js/components/CheckoutUI.js +++ b/checkout/src/arquivos/js/components/CheckoutUI.js @@ -16,6 +16,7 @@ export default class CheckoutUI { selectors() { this.title = $(".footerCheckout__title"); this.contents = $(".footerCheckout__content"); + this.entrega = $('.shipping-date'); } events() { @@ -42,6 +43,7 @@ export default class CheckoutUI { waitForEl(".product-image img", this.resizeImages.bind(this)); $(window).on("orderFormUpdated.vtex", this.resizeImages.bind(this)); this.changeTitleChooseProduct(); + this.entregaCarrinho(); } configThumb() { @@ -67,5 +69,4 @@ export default class CheckoutUI { ); }); } - } diff --git a/checkout/src/arquivos/js/components/Footer.js b/checkout/src/arquivos/js/components/Footer.js index 10c96e1..ef29240 100644 --- a/checkout/src/arquivos/js/components/Footer.js +++ b/checkout/src/arquivos/js/components/Footer.js @@ -9,11 +9,13 @@ export default class Footer { await this.selectors(); this.verificaPag(); await this.onUpdate(); + await this.addCarrossel(); + this.addProdutos(); + this.entregaCarrinho(); + this.unidadeCarrinho(); this.creatPaymentsIcons(); this.creatVtexIconPci(); this.creatDevIconsM3(); - this.addProdutos(); - await this.addCarrossel(); } async selectors() { @@ -24,6 +26,9 @@ export default class Footer { this.vtexIconPci = await waitElement('.footerCheckout__vtexpci'); this.devIcons = await waitElement('.footerCheckout__developedBy'); this.continuarComprando = await waitElement('.empty-cart-links'); + this.entrega = await waitElement('.shipping-date'); + this.unidade = await waitElement('.product-price'); + } async onUpdate() { @@ -102,22 +107,52 @@ export default class Footer { }; async addCarrossel() { const prateleiraProd = await waitElement("#footerCheckout__prateleira-ul-id"); - if(window.screen.width > 1024) { $(prateleiraProd).slick({ slidesToShow: 4, slidesToScroll: 1, infinite: false, arrows: true, + // responsive: [ + // { + // breackpoint: 992, + // settings: { + // slidesToScroll: 2, + // slidesToScroll: 1, + // }, + // }, + // { + // breackpoint: 1025, + // settings: { + // slidesToShow: 3, + // slidesToScroll: 1, + // } + // }, + // { + // breackpoint: 1279, + // settings: { + // slidesToShow: 4, + // slidesToScroll: 1, + // } + // }, + // ] }); - } + } addProdutos() { this.continuarComprando.innerHTML = `continuar comprando` } - // removePrateleira() { - // this.divPrateleira.style.display = 'none' - // }; + removePrateleira() { + this.divPrateleira.style.display = 'none' + }; + + entregaCarrinho () { + this.entrega.innerHTML = `Frete`; + } + unidadeCarrinho () { + this.unidade.innerHTML = `Unidade`; + } + creatPaymentsIcons () { this.payments.innerHTML = `