From 956c39fc9d1e0a38f7677a1dce645166ef933a61 Mon Sep 17 00:00:00 2001 From: carloswinter Date: Sun, 18 Dec 2022 23:01:09 -0300 Subject: [PATCH] feat(footer): corrige logica e css em scss para a prateleira --- checkout/src/arquivos/js/components/Footer.js | 22 +++++-------------- checkout/src/arquivos/js/components/Header.js | 7 ++---- .../sass/checkout/_checkout-autenticacao.scss | 3 +++ .../sass/checkout/_checkout-carrinho.scss | 12 ++++++++++ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/checkout/src/arquivos/js/components/Footer.js b/checkout/src/arquivos/js/components/Footer.js index a518996..fa8cbf0 100644 --- a/checkout/src/arquivos/js/components/Footer.js +++ b/checkout/src/arquivos/js/components/Footer.js @@ -31,7 +31,7 @@ export default class Footer { } this.cartTitle.style.display = "block"; } - console.log("HASHCHANGE FOOTER"); + if (window.location.hash == "#/cart" && this.checkoutVazio.style.display == "none") { this.list.style.display = "flex"; } @@ -56,7 +56,7 @@ export default class Footer { // timeout: 5000, // interval: 1000, // }); - this.allList = await waitElement(".footerCheckout"); + this.fullList = await waitElement(".footerCheckout"); this.checkoutVazio = await waitElement(".empty-cart-content"); this.payments = await waitElement(".footerCheckout__payments"); this.vtexpci = await waitElement(".footerCheckout__vtexpci"); @@ -70,12 +70,11 @@ export default class Footer { let lista = this.list; let cartTitle = this.cartTitle; - console.log("title:", cartTitle); + if (target.style.display == "none" && window.location.hash == "#/cart") { lista.style.display = "flex"; cartTitle.style.display = "block"; if (!this.list.classList.contains("fetch")) { - console.log("PRIMEIRO NAO TEM FETCH"); this.fetchApiData(); } } else { @@ -85,9 +84,7 @@ export default class Footer { let config = { childList: true, attributes: true }; let observer = new MutationObserver((mutations) => { if (window.location.hash == "#/cart") { - console.log("listairai", this.list.classList); if (!lista.classList.contains("fetch")) { - console.log("SEGUNDO NAO TEM FETCH"); this.fetchApiData(); } mutations.forEach(function (mutation) { @@ -104,7 +101,6 @@ export default class Footer { lista.style.display = "flex"; cartTitle.style.display = "block"; } - console.log(mutation.type); }); } }); @@ -113,7 +109,6 @@ export default class Footer { } async addCarrossel() { - console.log("start slick"); const elemento = await waitElement(".slick-test"); if ($(elemento).hasClass("slick-initialized")) { $(elemento).slick("unslick"); @@ -134,18 +129,14 @@ export default class Footer { slidesToScroll: 1, }); } - - console.log("end slick"); } fetchApiData() { - console.log("COMEƇO FETCH"); fetch( "https://m3academy.myvtex.com/api/catalog_system/pub/products/search/?fq=productClusterIds:319" ) .then((response) => response.json()) .then((data) => { - console.log(data); const ul = document.createElement("ul"); ul.classList.add("slick-test"); @@ -158,7 +149,6 @@ export default class Footer { data.map((item) => { let colors = ""; for (let i = 0; i < item.items.length; i++) { - console.log(colors); colors += `

${item.items[i].name}

`; } const li = document.createElement("li"); @@ -170,18 +160,16 @@ export default class Footer { ${colors} VER PRODUTO`; - console.log(item.productName, colors); - console.log("adiciona li"); + ul.appendChild(li); this.list.classList.add("fetch"); - console.log(this.list); + ul.style.width = "100%"; }); }) .then(() => { this.addCarrossel(); }); - console.log("FIM FETCH"); } createPaymentsIcons() { diff --git a/checkout/src/arquivos/js/components/Header.js b/checkout/src/arquivos/js/components/Header.js index bfa1e44..c434ae6 100644 --- a/checkout/src/arquivos/js/components/Header.js +++ b/checkout/src/arquivos/js/components/Header.js @@ -95,14 +95,11 @@ export default class Header { if (this.circle1.classList.contains("active")) { this.circle1.classList.remove("active"); } - console.log("email shipping"); - console.log(this.circle1); + if (this.circle2) { this.circle2.classList.add("active"); - console.log("teste dados"); } - console.log(this.circle2); - console.log(this.circle3); + if (this.circle3) { if (this.circle3.classList.contains("active")) { this.circle3.classList.remove("active"); diff --git a/checkout/src/arquivos/sass/checkout/_checkout-autenticacao.scss b/checkout/src/arquivos/sass/checkout/_checkout-autenticacao.scss index 50ce5cb..d3d780b 100644 --- a/checkout/src/arquivos/sass/checkout/_checkout-autenticacao.scss +++ b/checkout/src/arquivos/sass/checkout/_checkout-autenticacao.scss @@ -537,6 +537,9 @@ padding: 0; .box-step { + .vtex-omnishipping-1-x-backToAddressList { + display: none; + } .vtex-omnishipping-1-x-addressForm { .vtex-omnishipping-1-x-address { display: flex; diff --git a/checkout/src/arquivos/sass/checkout/_checkout-carrinho.scss b/checkout/src/arquivos/sass/checkout/_checkout-carrinho.scss index dc692cd..a24889f 100644 --- a/checkout/src/arquivos/sass/checkout/_checkout-carrinho.scss +++ b/checkout/src/arquivos/sass/checkout/_checkout-carrinho.scss @@ -5,6 +5,13 @@ } .cart-template { + .summary-template-holder { + .row-fluid { + @media (max-width: 1024px) { + display: block !important; + } + } + } @include mq(l, max) { display: flex; flex-direction: column; @@ -64,6 +71,11 @@ border-top: none; margin-top: 0; padding-top: 0; + .description { + .pull-left { + display: none; + } + } &:not(:first-child) { margin-top: 8px;