This commit is contained in:
Jonathan Chevalier
2022-10-19 17:57:46 +02:00
parent da9a5580bb
commit 725a0228cd
2 changed files with 15 additions and 6 deletions

View File

@@ -19,7 +19,8 @@ let date = {collectExpress: null, deliveryExpress: null, collectFacteur: null, d
const currentDay = format(today, 'e') const currentDay = format(today, 'e')
//const isWeekEnd = (currentDay === '7' || currentDay === '8') //const isWeekEnd = (currentDay === '7' || currentDay === '8')
if (format(today, 'HH') > 17) {
if (format(today, 'HH') > 16) {
date.collectExpress = date.deliveryExpress = tomorrow date.collectExpress = date.deliveryExpress = tomorrow
} else { } else {
date.collectExpress = date.deliveryExpress = today date.collectExpress = date.deliveryExpress = today

View File

@@ -7,7 +7,8 @@
<span v-if="store.withPrescription">Oui</span> <span v-if="store.withPrescription">Oui</span>
<span v-else>Non</span> <span v-else>Non</span>
</div> </div>
<div class="mb-2" v-if="store.withPrescription"><strong>Date de collect de l'orodnnance <div class="mb-2" v-if="store.withPrescription && store.deliveryMethod === 'MMCM_FACTEUR'"><strong>Date de collect
de l'orodnnance
: </strong>{{ store.dateCollectString }} : </strong>{{ store.dateCollectString }}
</div> </div>
<div class="mb-2"><strong>Date de livraison des medicaments : </strong>{{ store.dateDeliveryString }}</div> <div class="mb-2"><strong>Date de livraison des medicaments : </strong>{{ store.dateDeliveryString }}</div>
@@ -43,15 +44,22 @@ export default {
let urlApi = '/php/api/v3/mmcm.php?EXEC=addToCart&ID_PRODUCT=' + this.store.idProduct let urlApi = '/php/api/v3/mmcm.php?EXEC=addToCart&ID_PRODUCT=' + this.store.idProduct
+ '&with_prescription=' + this.store.withPrescription + '&with_prescription=' + this.store.withPrescription
+ '&date_delivery=' + this.store.dateDeliveryTimestampInSecond + '&date_delivery=' + this.store.dateDeliveryTimestampInSecond
+ '&date_collect=' + this.store.dateCollectTimestampInSecond
+ '&street=' + encodeURI(this.store.street) + '&street=' + encodeURI(this.store.street)
+ '&zip_code=' + this.store.zipCode + '&zip_code=' + this.store.zipCode
+ '&city=' + this.store.city + '&city=' + this.store.city
; ;
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) { if (import.meta.env.DEV) {
console.log(urlApi) console.log(urlApi)
urlApi += '&ID_SESSION=6xCvNjBA'; urlApi += '&ID_SESSION=0w1YDpPz';
} }
const result = await fetch(urlApi).then(rep => rep.json()) const result = await fetch(urlApi).then(rep => rep.json())