|
|
|
@ -93,11 +93,14 @@
|
|
|
|
|
:class="!isAccount ? 'flex-column' : ''"
|
|
|
|
|
>
|
|
|
|
|
<el-checkbox v-model="defaultAddress">设为默认地址</el-checkbox>
|
|
|
|
|
<div class="address__edit--btns flex flex-middle" :class="isAccount?'clearmargin':''">
|
|
|
|
|
<div
|
|
|
|
|
class="address__edit--btns flex flex-middle"
|
|
|
|
|
:class="isAccount ? 'clearmargin' : ''"
|
|
|
|
|
>
|
|
|
|
|
<UiButton
|
|
|
|
|
v-if="addressList[0].id && !isAccount"
|
|
|
|
|
type="grey"
|
|
|
|
|
@click="isOperation = false"
|
|
|
|
|
@click="onCanceloperation()"
|
|
|
|
|
>取消</UiButton
|
|
|
|
|
>
|
|
|
|
|
<UiButton type="yellow_panel" @click="onAddAddress"
|
|
|
|
@ -206,6 +209,18 @@ export default {
|
|
|
|
|
this.getAddressData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onCanceloperation() {
|
|
|
|
|
let vm = this;
|
|
|
|
|
vm.isOperation = false;
|
|
|
|
|
vm.$set(vm.selectData.area, "value", "");
|
|
|
|
|
vm.$set(vm.selectData.city, "value", "");
|
|
|
|
|
vm.$set(vm.selectData.province, "value", "");
|
|
|
|
|
vm.$set(vm, "detailAddress", "");
|
|
|
|
|
vm.$set(vm, "defaultAddress", "");
|
|
|
|
|
vm.$set(vm, "addressUser", "");
|
|
|
|
|
vm.$set(vm, "addressPhone", "");
|
|
|
|
|
vm.$emit("onSaveSuccess");
|
|
|
|
|
},
|
|
|
|
|
onEdit() {
|
|
|
|
|
let vm = this;
|
|
|
|
|
let curIndex = vm.addressList.findIndex(
|
|
|
|
@ -260,8 +275,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
async onAddAddress() {
|
|
|
|
|
let vm = this;
|
|
|
|
|
let curItem = vm.addressList.find((item) => item.id == vm.curAddressListItem.id);
|
|
|
|
|
console.log(vm.selectData)
|
|
|
|
|
let curItem = vm.addressList.find(
|
|
|
|
|
(item) => item.id == vm.curAddressListItem.id
|
|
|
|
|
);
|
|
|
|
|
console.log(vm.selectData);
|
|
|
|
|
if (!vm.selectData?.area?.code) {
|
|
|
|
|
vm.$message.error("请选择所在区域~");
|
|
|
|
|
return;
|
|
|
|
@ -274,7 +291,7 @@ export default {
|
|
|
|
|
vm.$message.error("请输入收货人~");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!IsPhone(vm.addressPhone)&&vm.addressPhone!=curItem.phone) {
|
|
|
|
|
if (!IsPhone(vm.addressPhone) && vm.addressPhone != curItem.phone) {
|
|
|
|
|
vm.$message.error("请输入收货人手机号码~");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -413,7 +430,7 @@ export default {
|
|
|
|
|
margin-right: 38px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.clearmargin{
|
|
|
|
|
.clearmargin {
|
|
|
|
|
margin: 0 0 0 20px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|