WIP MMCM
This commit is contained in:
@@ -8,33 +8,43 @@
|
||||
<span v-else>Non</span>
|
||||
</div>
|
||||
<div class="mb-2"><strong>Date de livraison des medicaments : </strong>{{ store.dateDeliveryString }}</div>
|
||||
<button class="btn btn-primary" @click="addToCart"><i class="fa-regular fa-circle-check fa-fw"></i> Ajouter au panier</button>
|
||||
<button class="btn btn-primary" @click="addToCart">
|
||||
|
||||
<i v-if="suspens" class="fa-solid fa-circle-notch fa-spin fa-fw"></i>
|
||||
<i v-else class="fa-regular fa-circle-check fa-fw"></i>
|
||||
Ajouter au panier
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {useMMCMStore} from '../stores/mmcm.js'
|
||||
import {ref} from "vue";
|
||||
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const suspens = ref(false)
|
||||
const store = useMMCMStore()
|
||||
return {
|
||||
suspens,
|
||||
store
|
||||
}
|
||||
},
|
||||
name: "delivery-option-summary",
|
||||
methods: {
|
||||
addToCart: async function (idProduct) {
|
||||
this.suspens = true
|
||||
const urlApi = '/php/api/v3/mmcm.php?EXEC=addToCart&ID_PRODUCT=' + this.store.idProduct
|
||||
+ '&with_prescription=' + this.store.widthPrescription
|
||||
+ '&date_delivery=' + this.store.dateDelivery
|
||||
;
|
||||
|
||||
|
||||
const result = await fetch(urlApi)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
this.suspens = false
|
||||
this.$router.push({path : '/final-step'})
|
||||
return response.json();
|
||||
}
|
||||
})
|
||||
|
||||
22
src/views/final-step.vue
Normal file
22
src/views/final-step.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<h2 class="mb-4">Votre ordonnance livré à domicile a été ajoutée au panier</h2>
|
||||
|
||||
<button class="btn btn-secondary me-4" @click="exitVueApp('/')">Continuer mes achats</button>
|
||||
<button class="btn btn-primary" @click="exitVueApp('/cart/p/AFF_COMM/0/0/')">Finaliser ma commande</button>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "final-step",
|
||||
methods: {
|
||||
exitVueApp(url) {
|
||||
window.location = 'https://para-php7-dev.parapharmacie-et-medicament.com' + url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user