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