forked from M3-Academy/m3-academy-template-checkout
feat(home):adicao do fetch
This commit is contained in:
parent
2473a6c1b9
commit
43fcbc6e1b
@ -32,9 +32,7 @@ export default class CheckoutUI {
|
||||
toggleFooterDropdown(event) {
|
||||
event.target.classList.toggle("closed");
|
||||
|
||||
event.target.nextElementSibling.classList.toggle(
|
||||
"dropdown__content--closed"
|
||||
);
|
||||
event.target.nextElementSibling.classList.toggle("dropdown__content--closed");
|
||||
}
|
||||
|
||||
init() {
|
||||
@ -56,14 +54,7 @@ export default class CheckoutUI {
|
||||
resizeImages() {
|
||||
$(".product-image img").each((i, el) => {
|
||||
const $el = $(el);
|
||||
$el.attr(
|
||||
"src",
|
||||
alterarTamanhoImagemSrcVtex(
|
||||
$el.attr("src"),
|
||||
this.width,
|
||||
this.height
|
||||
)
|
||||
);
|
||||
$el.attr("src", alterarTamanhoImagemSrcVtex($el.attr("src"), this.width, this.height));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class Header {
|
||||
await this.removeCartTitle();
|
||||
await this.alterarCartChooseProducts();
|
||||
await this.alterarEmptyCartTitle();
|
||||
await this.api();
|
||||
}
|
||||
|
||||
async selectors() {
|
||||
@ -81,14 +82,15 @@ export default class Header {
|
||||
this.emptyCartTitle.innerHTML = "Seu carrinho está vazio";
|
||||
}
|
||||
|
||||
// async progressBarProgress(){
|
||||
// if(this.progressBar && window.innerWidth > 1024){
|
||||
// const progressBarLista = document.querySelectorAll("#progressBar ul li");
|
||||
// progressBarLista.forEach((li) => {
|
||||
// if(window.location.href) === "https://m3academy.myvtex.com/checkout/#/cart"{
|
||||
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
async api() {
|
||||
fetch(
|
||||
"https://m3academy.myvtex.com/api/catalog_system/pub/products/search/?fq=productClusterIds:319"
|
||||
)
|
||||
.then((Response) => {
|
||||
return Response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -178,6 +178,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
th {
|
||||
font-family: "Tenor Sans", sans-serif;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
td.shipping-date {
|
||||
color: $color-gray2;
|
||||
font-size: 12px;
|
||||
@ -190,6 +195,7 @@
|
||||
|
||||
.product-price {
|
||||
min-width: 100px;
|
||||
|
||||
@include mq(md, max) {
|
||||
min-width: 78px;
|
||||
}
|
||||
@ -356,7 +362,8 @@
|
||||
font-weight: normal;
|
||||
font-size: 24px;
|
||||
line-height: 28px;
|
||||
color: $color-gray2;
|
||||
color: $color-black-100;
|
||||
// color: $color-gray2;
|
||||
|
||||
@include mq(md, max) {
|
||||
margin-top: 0;
|
||||
|
@ -4,8 +4,13 @@ body .container-main.container-order-form .orderform-template.active {
|
||||
margin-left: unset;
|
||||
margin-right: 0;
|
||||
float: right;
|
||||
min-height: 100%;
|
||||
}
|
||||
.orderform-template-holder {
|
||||
width: 66.1132%;
|
||||
}
|
||||
}
|
||||
|
||||
.container-main {
|
||||
min-height: unset;
|
||||
}
|
||||
|
23
package-lock.json
generated
23
package-lock.json
generated
@ -17,7 +17,8 @@
|
||||
"dependencies": {
|
||||
"@commitlint/cli": "^12.0.1",
|
||||
"@commitlint/config-conventional": "^12.0.1",
|
||||
"slick-carousel": "^1.8.1"
|
||||
"slick-carousel": "^1.8.1",
|
||||
"yarn": "^1.22.19"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^6.0.0",
|
||||
@ -45,6 +46,7 @@
|
||||
"jquery": "^3.6.0",
|
||||
"m3-utils": "^0.1.0",
|
||||
"sass": "^1.38.1",
|
||||
"slick-carousel": "^1.8.1",
|
||||
"terser-webpack-plugin": "^5.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -17668,6 +17670,19 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yarn": {
|
||||
"version": "1.22.19",
|
||||
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.19.tgz",
|
||||
"integrity": "sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ==",
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"yarn": "bin/yarn.js",
|
||||
"yarnpkg": "bin/yarn.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/yocto-queue": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
@ -19345,6 +19360,7 @@
|
||||
"m3-utils": "^0.1.0",
|
||||
"prettier": "^2.3.2",
|
||||
"sass": "^1.38.1",
|
||||
"slick-carousel": "^1.8.1",
|
||||
"terser-webpack-plugin": "^5.1.4",
|
||||
"webpack": "^5.51.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
@ -30672,6 +30688,11 @@
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
|
||||
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA=="
|
||||
},
|
||||
"yarn": {
|
||||
"version": "1.22.19",
|
||||
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.19.tgz",
|
||||
"integrity": "sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ=="
|
||||
},
|
||||
"yocto-queue": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
|
@ -35,6 +35,7 @@
|
||||
"dependencies": {
|
||||
"@commitlint/cli": "^12.0.1",
|
||||
"@commitlint/config-conventional": "^12.0.1",
|
||||
"slick-carousel": "^1.8.1"
|
||||
"slick-carousel": "^1.8.1",
|
||||
"yarn": "^1.22.19"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user