WIP MMCM
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" role="alert" v-if="!geolocation">
|
||||
Nous sommes désolé nous ne parvenons pas à géolocaliser l'adresse saisie<br/>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-text">
|
||||
<i v-if="isSearching" class="fa-solid fa-circle-notch fa-spin fa-fw text-success"></i>
|
||||
@@ -17,7 +21,8 @@
|
||||
<input type="text" placeholder="Exemple : 9 Impasse des Peupliers 13008 Marseille" class="form-control"
|
||||
v-model="query"
|
||||
@input="updateSearchResult" aria-describedby="button-addon">
|
||||
<button class="btn btn-primary" type="button" id="button-addon" @click="[this.currentBtSearch = 'liveSearch',checkIdAddressIsEligible()]">
|
||||
<button class="btn btn-primary" type="button" id="button-addon"
|
||||
@click="[this.currentBtSearch = 'liveSearch',checkIdAddressIsEligible()]">
|
||||
<i v-if="isChecking && currentBtSearch === 'liveSearch'" class="fa-solid fa-circle-notch fa-spin fa-fw"></i>
|
||||
<i v-else class="fa-regular fa-circle-check fa-fw"></i>
|
||||
Valider
|
||||
@@ -45,7 +50,8 @@
|
||||
{{ address.street }}<br/>
|
||||
{{ address.zip_code }} {{ address.city }}<br/><br/>
|
||||
<button class="btn btn-primary" type="button" @click="useAddressBook(address,i)">
|
||||
<i v-if="isChecking && currentBtSearch === 'addressBook'+i" class="fa-solid fa-circle-notch fa-spin fa-fw"></i>
|
||||
<i v-if="isChecking && currentBtSearch === 'addressBook'+i"
|
||||
class="fa-solid fa-circle-notch fa-spin fa-fw"></i>
|
||||
<i v-else class="fa-regular fa-circle-check fa-fw"></i>
|
||||
Choisir cette adresse
|
||||
</button>
|
||||
@@ -87,14 +93,15 @@ export default {
|
||||
searchResults: [],
|
||||
isSearching: false,
|
||||
isChecking: false,
|
||||
geolocation: true,
|
||||
addressBook: [],
|
||||
isConnected: null,
|
||||
currentBtSearch : null
|
||||
currentBtSearch: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
useAddressBook(address,i) {
|
||||
this.currentBtSearch = 'addressBook'+i
|
||||
useAddressBook(address, i) {
|
||||
this.currentBtSearch = 'addressBook' + i
|
||||
|
||||
this.store.setStreet(address.street)
|
||||
this.store.setZipCode(address.zip_code)
|
||||
@@ -132,7 +139,9 @@ export default {
|
||||
+ '&zip_code=' + this.store.zipCode
|
||||
+ '&city=' + this.store.city
|
||||
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
console.log(urlApi)
|
||||
}
|
||||
let productList = await fetch(urlApi)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
@@ -143,14 +152,17 @@ export default {
|
||||
|
||||
this.isChecking = false
|
||||
|
||||
if (productList.length > 0) {
|
||||
if (productList.hasOwnProperty('data') && productList.data.result === 'KO') {
|
||||
this.geolocation = false
|
||||
this.noOfferFound = false
|
||||
} else if (productList.length > 0) {
|
||||
this.store.setProductList(productList);
|
||||
this.$router.push({path: '/delivery-option-step-1'});
|
||||
} else {
|
||||
this.noOfferFound = true
|
||||
this.geolocation = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<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>
|
||||
Ajouter au panier
|
||||
Confirmer
|
||||
</button>
|
||||
</div>
|
||||
<div class="text-start">
|
||||
|
||||
Reference in New Issue
Block a user