WIP MMCM
This commit is contained in:
@@ -81,6 +81,8 @@ export const useMMCMStore = defineStore('counter', {
|
|||||||
methodDelivery: 'Main propre',
|
methodDelivery: 'Main propre',
|
||||||
methodCollect: 'Main propre',
|
methodCollect: 'Main propre',
|
||||||
timeSlot : null,
|
timeSlot : null,
|
||||||
|
partialDelivery : false,
|
||||||
|
generalMedicine : true,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
fullAddress: (state) => (state.street !== null) ? state.street + ' ' + state.zipCode + ' ' + state.city : null,
|
fullAddress: (state) => (state.street !== null) ? state.street + ' ' + state.zipCode + ' ' + state.city : null,
|
||||||
@@ -94,6 +96,9 @@ export const useMMCMStore = defineStore('counter', {
|
|||||||
needPrescriptionDateCollect: (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription),
|
needPrescriptionDateCollect: (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription),
|
||||||
dateDeliveryTimestampInSecond: (state) => timestampConverter(state.dateDelivery),
|
dateDeliveryTimestampInSecond: (state) => timestampConverter(state.dateDelivery),
|
||||||
dateCollectTimestampInSecond: (state) => timestampConverter(state.dateCollect),
|
dateCollectTimestampInSecond: (state) => timestampConverter(state.dateCollect),
|
||||||
|
generalMedicineAgreement:(state) => (state.generalMedicine) ? 'Oui' : 'Non',
|
||||||
|
partialDeliveryWish:(state) => (state.partialDelivery) ? 'Oui' : 'Non',
|
||||||
|
|
||||||
msgDelivery: (state) => {
|
msgDelivery: (state) => {
|
||||||
|
|
||||||
//console.log(formatDistance(date.deliveryExpress, today))
|
//console.log(formatDistance(date.deliveryExpress, today))
|
||||||
|
|||||||
@@ -1,19 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6">
|
||||||
<div class="step_title">Recapitulatif :</div>
|
<div class="step_title">Recapitulatif :</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
<router-link to="/address-check" class="btn btn-secondary me-4">
|
|
||||||
<i class="fa-regular fa-arrow-alt-circle-left fa-fw"></i>
|
|
||||||
Modifier mes choix
|
|
||||||
</router-link>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
Confirmer
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="text-start">
|
<div class="text-start">
|
||||||
<div class="mb-4"><i class="fa-solid fa-location-dot fa-fw text-primary me-2"></i><strong>Adresse de livraison
|
<div class="mb-4"><i class="fa-solid fa-location-dot fa-fw text-primary me-2"></i><strong>Adresse de livraison
|
||||||
: </strong>{{ store.fullAddress }}
|
: </strong>{{ store.fullAddress }}
|
||||||
@@ -37,11 +26,48 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="step_title">Informations complémentaires :</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" :value="true" id="generique_choice" v-model="generalMedicine">
|
||||||
|
<label class="form-check-label" for="generique_choice">
|
||||||
|
J'accepte les médicaments génériques sauf mentions écrites du médecin ou instructions personnelles contraires.
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" :value="true" id="partial_delivery" v-model="partialDelivery">
|
||||||
|
<label class="form-check-label" for="partial_delivery">
|
||||||
|
Je souhaite une livraison partielle (un pharmacien appelera pour préciser vos intentions)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-4 d-flex flex-row">
|
||||||
|
<router-link to="/address-check" class="btn btn-secondary me-4">
|
||||||
|
<i class="fa-regular fa-arrow-alt-circle-left fa-fw"></i>
|
||||||
|
Modifier mes choix
|
||||||
|
</router-link>
|
||||||
|
|
||||||
|
<button class="btn btn-primary ms-auto" @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>
|
||||||
|
Confirmer
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {useMMCMStore} from '../stores/mmcm.js'
|
import {useMMCMStore} from '../stores/mmcm.js'
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
|
import {storeToRefs} from "pinia";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -49,8 +75,12 @@ export default {
|
|||||||
const suspens = ref(false)
|
const suspens = ref(false)
|
||||||
const store = useMMCMStore()
|
const store = useMMCMStore()
|
||||||
|
|
||||||
|
const {generalMedicine, partialDelivery} = storeToRefs(store)
|
||||||
|
|
||||||
const urlGoogleMap = "https://www.google.com/maps?width=100%25&height=600&hl=en&q=" + encodeURI(store.fullAddress) + "&t=&z=17&ie=UTF8&iwloc=B&output=embed"
|
const urlGoogleMap = "https://www.google.com/maps?width=100%25&height=600&hl=en&q=" + encodeURI(store.fullAddress) + "&t=&z=17&ie=UTF8&iwloc=B&output=embed"
|
||||||
return {
|
return {
|
||||||
|
generalMedicine,
|
||||||
|
partialDelivery,
|
||||||
suspens,
|
suspens,
|
||||||
store,
|
store,
|
||||||
urlGoogleMap
|
urlGoogleMap
|
||||||
@@ -67,6 +97,8 @@ export default {
|
|||||||
+ '&date_delivery=' + this.store.dateDeliveryTimestampInSecond
|
+ '&date_delivery=' + this.store.dateDeliveryTimestampInSecond
|
||||||
+ '&method_delivery=' + this.store.methodDelivery
|
+ '&method_delivery=' + this.store.methodDelivery
|
||||||
+ '&time_slot=' + this.store.displayTimeSlot
|
+ '&time_slot=' + this.store.displayTimeSlot
|
||||||
|
+ '&general_medicine=' + this.store.generalMedicineAgreement
|
||||||
|
+ '&partial_delivery=' + this.store.partialDeliveryWish
|
||||||
+ '&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
|
||||||
@@ -79,7 +111,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
urlApi += '&ID_SESSION=YN2nLi3m';
|
urlApi += '&ID_SESSION=BP6XBH42';
|
||||||
console.log(urlApi)
|
console.log(urlApi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user