toast replace by modals, and product filters working

This commit is contained in:
María
2025-08-28 13:53:06 +02:00
parent 49855b11fd
commit 71274defb2
5 changed files with 66 additions and 49 deletions

View File

@@ -106,6 +106,13 @@
<ProductsRelated :related-products="relatedProducts" />
</div>
<ProductModal v-if="modal" :product="product" @close-modal="closeModal" />
<BModal
id="modal-center"
v-model="active"
centered
title="latienda.coop"
:ok-variant="modalColor"> {{ modalText }}
</BModal>
</div>
</template>
@@ -137,6 +144,9 @@ export default {
modal: true,
productUrl: null,
geolocation: null,
active: false,
modalText: '',
modalColor: 'info',
}
},
computed: {
@@ -161,19 +171,13 @@ export default {
},
closeModal(value) {
this.modal = false
if (value === 200) {
this.$bvToast.toast(`Email enviado correctamente`, {
title: 'latienda.coop',
autoHideDelay: 5000,
appendToast: true,
})
if (value === 200 || value === 201) {
this.modalText = 'Actualizado correctamente'
this.modalColor = 'success'
} else if (value) {
this.$bvToast.toast(`Se ha producido un error en el envío`, {
title: 'latienda.coop',
autoHideDelay: 5000,
appendToast: true,
variant: 'danger',
})
this.modalText = 'Se ha producido un error en el envío'
this.modalColor = 'danger'
}
},
// TODO: implement buyIntent (review functionality, because sendLog is not working)