This commit is contained in:
Jonathan Chevalier
2022-10-18 15:57:04 +02:00
parent e934f93f33
commit 675e291b6d
2 changed files with 5 additions and 1 deletions

View File

@@ -83,10 +83,12 @@ export const useMMCMStore = defineStore('counter', {
fullAddress: (state) => state.street + ' ' + state.zipCode + ' ' + state.city,
deliveryMethod: (state) => state.productList.filter(p => p.id === state.idProduct)[0].name,
dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR"),
dateCollectString: (state) => new Date(state.dateCollect).toLocaleDateString("fr-FR"),
minDateForDelivery: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? date.deliveryExpress : date.deliveryFacteur,
minDateForCollect: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? date.collectExpress : date.collectFacteur,
needPrescriptionDateCollect: (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription),
dateDeliveryTimestampInSecond: (state) => timestampConverter(state.dateDelivery),
dateCollectTimestampInSecond: (state) => timestampConverter(state.dateCollect),
msgDelivery : (state) => {
//console.log(formatDistance(date.deliveryExpress, today))

View File

@@ -7,6 +7,7 @@
<span v-if="store.withPrescription">Oui</span>
<span v-else>Non</span>
</div>
<div class="mb-2" v-if="store.withPrescription"><strong>Date de collect de l'orodnnance : </strong>{{ store.dateCollectString }}</div>
<div class="mb-2"><strong>Date de livraison des medicaments : </strong>{{ store.dateDeliveryString }}</div>
<button class="btn btn-primary" @click="addToCart">
@@ -40,13 +41,14 @@ 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){
urlApi += '&ID_SESSION=uYkQcd22'
urlApi += '&ID_SESSION=hvat7Etm'
console.log(urlApi)
}