WIP MMCM
This commit is contained in:
@@ -21,18 +21,29 @@
|
||||
{{ item.properties.label }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="alert alert-danger" role="alert" v-if="noOfferFound">
|
||||
Nous sommes désolé mais votre adresse est trop eloignée de la pharmacie pour bénéficier de ce service<br/>
|
||||
Nous vous invitions à utiliser le service de La Poste pour trouver une pharmacie proche de chez vous :
|
||||
<a href="https://www.mesmedicamentschezmoi.com" target="_blank">Accéder à mesmedicamentschezmoi.com</a>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {ref} from 'vue';
|
||||
import {useMMCMStore} from '../stores/mmcm.js'
|
||||
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const store = useMMCMStore()
|
||||
const noOfferFound = ref(false)
|
||||
|
||||
return {
|
||||
store,
|
||||
noOfferFound
|
||||
}
|
||||
},
|
||||
name: "address-check",
|
||||
@@ -47,6 +58,7 @@ export default {
|
||||
methods: {
|
||||
updateSearchResult: async function () {
|
||||
this.isSearching = true
|
||||
this.noOfferFound = false
|
||||
this.searchResults = await fetch('https://api-adresse.data.gouv.fr/search/?q=' + this.query)
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
@@ -61,8 +73,6 @@ export default {
|
||||
this.store.setStreet(item.properties.name)
|
||||
this.store.setZipCode(item.properties.postcode)
|
||||
this.store.setCity(item.properties.city)
|
||||
|
||||
|
||||
},
|
||||
checkIdAddressIsEligible: async function () {
|
||||
this.isChecking = true
|
||||
@@ -79,9 +89,17 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
this.store.setProductList(productList);
|
||||
|
||||
this.isChecking = false
|
||||
this.$router.push({path: '/delivery-option-step-1'});
|
||||
|
||||
if (productList.length > 0) {
|
||||
this.store.setProductList(productList);
|
||||
this.$router.push({path: '/delivery-option-step-1'});
|
||||
} else {
|
||||
this.noOfferFound = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user