WIP MMCM
This commit is contained in:
@@ -81,6 +81,8 @@ export const useMMCMStore = defineStore('counter', {
|
||||
methodDelivery: 'Main propre',
|
||||
methodCollect: 'Main propre',
|
||||
timeSlot : null,
|
||||
partialDelivery : false,
|
||||
generalMedicine : true,
|
||||
}),
|
||||
getters: {
|
||||
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),
|
||||
dateDeliveryTimestampInSecond: (state) => timestampConverter(state.dateDelivery),
|
||||
dateCollectTimestampInSecond: (state) => timestampConverter(state.dateCollect),
|
||||
generalMedicineAgreement:(state) => (state.generalMedicine) ? 'Oui' : 'Non',
|
||||
partialDeliveryWish:(state) => (state.partialDelivery) ? 'Oui' : 'Non',
|
||||
|
||||
msgDelivery: (state) => {
|
||||
|
||||
//console.log(formatDistance(date.deliveryExpress, today))
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
<template>
|
||||
<div class="step_title">Recapitulatif :</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<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="mb-4"><i class="fa-solid fa-location-dot fa-fw text-primary me-2"></i><strong>Adresse de livraison
|
||||
: </strong>{{ store.fullAddress }}
|
||||
@@ -37,11 +26,48 @@
|
||||
</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>
|
||||
|
||||
<script>
|
||||
import {useMMCMStore} from '../stores/mmcm.js'
|
||||
import {ref} from "vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -49,8 +75,12 @@ export default {
|
||||
const suspens = ref(false)
|
||||
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"
|
||||
return {
|
||||
generalMedicine,
|
||||
partialDelivery,
|
||||
suspens,
|
||||
store,
|
||||
urlGoogleMap
|
||||
@@ -67,6 +97,8 @@ export default {
|
||||
+ '&date_delivery=' + this.store.dateDeliveryTimestampInSecond
|
||||
+ '&method_delivery=' + this.store.methodDelivery
|
||||
+ '&time_slot=' + this.store.displayTimeSlot
|
||||
+ '&general_medicine=' + this.store.generalMedicineAgreement
|
||||
+ '&partial_delivery=' + this.store.partialDeliveryWish
|
||||
+ '&street=' + encodeURI(this.store.street)
|
||||
+ '&zip_code=' + this.store.zipCode
|
||||
+ '&city=' + this.store.city
|
||||
@@ -79,7 +111,7 @@ export default {
|
||||
}
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
urlApi += '&ID_SESSION=YN2nLi3m';
|
||||
urlApi += '&ID_SESSION=BP6XBH42';
|
||||
console.log(urlApi)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user