development #5

Merged
carloswinter merged 17 commits from development into main 2022-12-19 02:33:51 +00:00
4 changed files with 22 additions and 22 deletions
Showing only changes of commit 956c39fc9d - Show all commits

View File

@ -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 += `<p>${item.items[i].name}</p>`;
}
const li = document.createElement("li");
@ -170,18 +160,16 @@ export default class Footer {
${colors}
</div>
<a class="productLink" type="button" href="${item.link}">VER PRODUTO</a>`;
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() {

View File

@ -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");

View File

@ -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;

View File

@ -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;