diff --git a/src/stores/mmcm.js b/src/stores/mmcm.js index 0b2f9c4..4bda83e 100644 --- a/src/stores/mmcm.js +++ b/src/stores/mmcm.js @@ -19,7 +19,8 @@ let date = {collectExpress: null, deliveryExpress: null, collectFacteur: null, d const currentDay = format(today, 'e') //const isWeekEnd = (currentDay === '7' || currentDay === '8') -if (format(today, 'HH') > 17) { + +if (format(today, 'HH') > 16) { date.collectExpress = date.deliveryExpress = tomorrow } else { date.collectExpress = date.deliveryExpress = today diff --git a/src/views/delivery-option-summary.vue b/src/views/delivery-option-summary.vue index 5a31c90..afd728b 100644 --- a/src/views/delivery-option-summary.vue +++ b/src/views/delivery-option-summary.vue @@ -7,7 +7,8 @@ Oui Non -
Date de collect de l'orodnnance +
Date de collect + de l'orodnnance : {{ store.dateCollectString }}
Date de livraison des medicaments : {{ store.dateDeliveryString }}
@@ -43,20 +44,27 @@ export default { let urlApi = '/php/api/v3/mmcm.php?EXEC=addToCart&ID_PRODUCT=' + this.store.idProduct + '&with_prescription=' + this.store.withPrescription + '&date_delivery=' + this.store.dateDeliveryTimestampInSecond - + '&date_collect=' + this.store.dateCollectTimestampInSecond + '&street=' + encodeURI(this.store.street) + '&zip_code=' + this.store.zipCode + '&city=' + this.store.city ; - if(import.meta.env.DEV){ + if (this.store.withPrescription) { + if (this.store.deliveryMethod === 'MMCM_FACTEUR') { + urlApi += '&date_collect=' + this.store.dateCollectTimestampInSecond + } else { + urlApi += '&date_collect=' + this.store.dateDeliveryTimestampInSecond + } + } + + if (import.meta.env.DEV) { console.log(urlApi) - urlApi += '&ID_SESSION=6xCvNjBA'; + urlApi += '&ID_SESSION=0w1YDpPz'; } const result = await fetch(urlApi).then(rep => rep.json()) - if(import.meta.env.DEV){ + if (import.meta.env.DEV) { console.log(result) }