|
|
|
@ -57,7 +57,14 @@
|
|
|
|
|
<article class="address__msg">
|
|
|
|
|
<div class="address__msg-line flex flex-middle">
|
|
|
|
|
<span class="address__msg-line--type">所在区域</span>
|
|
|
|
|
<no-ssr><v-distpicker @selected="onSelected"></v-distpicker></no-ssr>
|
|
|
|
|
<no-ssr
|
|
|
|
|
><v-distpicker
|
|
|
|
|
:province="selectData.province.value"
|
|
|
|
|
:city="selectData.city.value"
|
|
|
|
|
:area="selectData.area.value"
|
|
|
|
|
@selected="onSelected"
|
|
|
|
|
></v-distpicker
|
|
|
|
|
></no-ssr>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="address__msg-line flex flex-middle">
|
|
|
|
|
<span class="address__msg-line--type">详细地址</span>
|
|
|
|
@ -160,9 +167,20 @@ export default {
|
|
|
|
|
addressUser: "",
|
|
|
|
|
addressPhone: "",
|
|
|
|
|
defaultAddress: true,
|
|
|
|
|
selectData: {},
|
|
|
|
|
selectData: {
|
|
|
|
|
area: {
|
|
|
|
|
value: "",
|
|
|
|
|
},
|
|
|
|
|
city: {
|
|
|
|
|
value: "",
|
|
|
|
|
},
|
|
|
|
|
province: {
|
|
|
|
|
value: "",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
addressList: [{}],
|
|
|
|
|
curAddressListItem: 0,
|
|
|
|
|
editIndex: 0,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -187,6 +205,16 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
setAddressData(i) {
|
|
|
|
|
let vm = this;
|
|
|
|
|
vm.editIndex = i;
|
|
|
|
|
let editItem = vm.addressList[i];
|
|
|
|
|
console.log(editItem);
|
|
|
|
|
vm.$set(vm.selectData.area, "value", editItem.area);
|
|
|
|
|
vm.$set(vm.selectData.city, "value", editItem.city);
|
|
|
|
|
vm.$set(vm.selectData.province, "value", editItem.province);
|
|
|
|
|
vm.$set(vm, "detailAddress", editItem.detailAddress);
|
|
|
|
|
vm.$set(vm, "defaultAddress", editItem.isDefault);
|
|
|
|
|
vm.$set(vm, "addressUser", editItem.name);
|
|
|
|
|
vm.$set(vm, "addressPhone", editItem.phone);
|
|
|
|
|
},
|
|
|
|
|
onSwtich() {
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
@ -230,7 +258,8 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
let res;
|
|
|
|
|
if (vm.isEdit) {
|
|
|
|
|
res = await ApiPutAddress(params);
|
|
|
|
|
let editParams = Object.assign(vm.addressList[vm.editIndex], params);
|
|
|
|
|
res = await ApiPutAddress(editParams);
|
|
|
|
|
} else {
|
|
|
|
|
res = await ApiPostAddress(params);
|
|
|
|
|
}
|
|
|
|
|