{
self.showQuantityPopup = true;
document.body.setAttribute('data-popup-open', 'true');
});
window.addEventListener('open-quantity-popup', () => {
self.showQuantityPopup = true;
document.body.setAttribute('data-popup-open', 'true');
});
// Watch para quando popup fechar
this.$watch('showQuantityPopup', (value) => {
if (!value) {
document.body.removeAttribute('data-popup-open');
} else {
document.body.setAttribute('data-popup-open', 'true');
}
});
},
increaseQuantity() {
this.quantity++;
},
decreaseQuantity() {
if (this.quantity > 1) {
this.quantity--;
}
},
toggleBump(id) {
this.selectedBumps[id] = !this.selectedBumps[id];
},
isBumpSelected(id) {
return this.selectedBumps[id] === true;
},
updateShipping(state) {
this.selectedState = state;
if (!this.isPhysicalProduct || this.shippingType === 'free') {
this.shippingCost = 0;
} else if (this.shippingType === 'per_state' && state && this.shippingPerState[state]) {
this.shippingCost = parseFloat(this.shippingPerState[state]) || 0;
} else {
this.shippingCost = this.shippingFixedCost;
}
},
get productTotal() {
return this.basePrice * this.quantity;
},
get totalPrice() {
let total = this.productTotal;
for (const bump of this.orderBumps) {
if (this.selectedBumps[bump.id]) {
total += bump.price;
}
}
total += this.shippingCost;
return Math.max(0, total - this.couponDiscount);
},
payMethod: 'pix',
cardInstallments: 1,
cardInterestRates: { 1: 0, 2: 0.05, 3: 0.07 },
allowInstallments: false,
get cardTotalPrice() {
return this.totalPrice * (1 + (this.cardInterestRates[this.cardInstallments] || 0));
},
get displayTotalPrice() {
return this.payMethod === 'credit_card' ? (this.allowInstallments ? this.cardTotalPrice : this.totalPrice) : this.totalPrice;
},
get selectedBumpsTotal() {
let total = 0;
for (const bump of this.orderBumps) {
if (this.selectedBumps[bump.id]) {
total += bump.price;
}
}
return total;
},
formatPrice(value) {
return value.toLocaleString('pt-BR', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}
}">
Resumo do Pedido
casamento economico
No Segredos do Casamento Econômico você vai descobrir tudo o que me fez gastar menos de 7 mil reais no meu casamento, mesmo fazendo festa e tendo muitos convidados!