mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
courselocation in pause. we have to make changes in AddAddress component.
This commit is contained in:
parent
ad55cc0477
commit
61f6e95281
@ -5,25 +5,20 @@
|
||||
</h2>
|
||||
<div class="my-4">
|
||||
|
||||
<div>
|
||||
<show-address
|
||||
v-if="address"
|
||||
v-bind:address="address">
|
||||
</show-address>
|
||||
</div>
|
||||
<show-address
|
||||
v-if="address"
|
||||
v-bind:address="address">
|
||||
</show-address>
|
||||
|
||||
<!--ul class="record_actions">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-create" type="button" name="button">
|
||||
{{ $t('courselocation.add_temp_address') }}
|
||||
</button>
|
||||
<add-address
|
||||
modalAddTitle="courselocation.add_temp_address"
|
||||
modalEditTitle="courselocation.edit_temp_address"
|
||||
@addNewAddress="addTemporaryAddress">
|
||||
</add-address>
|
||||
</li>
|
||||
</ul-->
|
||||
<add-address
|
||||
modalAddTitle="courselocation.add_temp_address"
|
||||
modalEditTitle="courselocation.edit_temp_address"
|
||||
@addNewAddress="addTemporaryAddress">
|
||||
</add-address>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -39,10 +34,64 @@ export default {
|
||||
AddAddress,
|
||||
ShowAddress
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*
|
||||
address: {},
|
||||
errors: {},
|
||||
loading: false,
|
||||
success: false
|
||||
*/
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addTemporaryAddress({ address, modal }) {
|
||||
console.log('@@@ CLICK button addTemporaryAdress', address);
|
||||
|
||||
/*
|
||||
let newAddress = {
|
||||
'isNoAddress': address.isNoAddress,
|
||||
'street': address.isNoAddress ? '' : address.street,
|
||||
'streetNumber': address.isNoAddress ? '' : address.streetNumber,
|
||||
'postcode': {'id': address.selected.city.id},
|
||||
'floor': address.floor,
|
||||
'corridor': address.corridor,
|
||||
'steps': address.steps,
|
||||
'flat': address.flat,
|
||||
'buildingName': address.buildingName,
|
||||
'distribution': address.distribution,
|
||||
'extra': address.extra
|
||||
};
|
||||
|
||||
if (address.selected.address.point !== undefined){
|
||||
newAddress = Object.assign(newAddress, {
|
||||
'point': address.selected.address.point.coordinates
|
||||
});
|
||||
}
|
||||
|
||||
if (address.writeNewPostalCode){
|
||||
let newPostalCode = address.newPostalCode;
|
||||
newPostalCode = Object.assign(newPostalCode, {
|
||||
'country': {'id': address.selected.country.id },
|
||||
});
|
||||
newAddress = Object.assign(newAddress, {
|
||||
'newPostalCode': newPostalCode
|
||||
});
|
||||
}
|
||||
|
||||
console.log('===> ', this.addressId, newAddress);
|
||||
|
||||
if (this.edit){
|
||||
this.$store.dispatch('updateAddress', {
|
||||
addressId: this.addressId,
|
||||
newAddress: newAddress
|
||||
});
|
||||
} else {
|
||||
this.$store.dispatch('addAddress', newAddress);
|
||||
}
|
||||
*/
|
||||
|
||||
modal.showModal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user