|
|
@ -93,11 +93,14 @@
|
|
|
|
:class="!isAccount ? 'flex-column' : ''"
|
|
|
|
:class="!isAccount ? 'flex-column' : ''"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-checkbox v-model="defaultAddress">设为默认地址</el-checkbox>
|
|
|
|
<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
|
|
|
|
<UiButton
|
|
|
|
v-if="addressList[0].id && !isAccount"
|
|
|
|
v-if="addressList[0].id && !isAccount"
|
|
|
|
type="grey"
|
|
|
|
type="grey"
|
|
|
|
@click="isOperation = false"
|
|
|
|
@click="onCanceloperation()"
|
|
|
|
>取消</UiButton
|
|
|
|
>取消</UiButton
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<UiButton type="yellow_panel" @click="onAddAddress"
|
|
|
|
<UiButton type="yellow_panel" @click="onAddAddress"
|
|
|
@ -206,6 +209,18 @@ export default {
|
|
|
|
this.getAddressData();
|
|
|
|
this.getAddressData();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
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() {
|
|
|
|
onEdit() {
|
|
|
|
let vm = this;
|
|
|
|
let vm = this;
|
|
|
|
let curIndex = vm.addressList.findIndex(
|
|
|
|
let curIndex = vm.addressList.findIndex(
|
|
|
@ -260,8 +275,10 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async onAddAddress() {
|
|
|
|
async onAddAddress() {
|
|
|
|
let vm = this;
|
|
|
|
let vm = this;
|
|
|
|
let curItem = vm.addressList.find((item) => item.id == vm.curAddressListItem.id);
|
|
|
|
let curItem = vm.addressList.find(
|
|
|
|
console.log(vm.selectData)
|
|
|
|
(item) => item.id == vm.curAddressListItem.id
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
console.log(vm.selectData);
|
|
|
|
if (!vm.selectData?.area?.code) {
|
|
|
|
if (!vm.selectData?.area?.code) {
|
|
|
|
vm.$message.error("请选择所在区域~");
|
|
|
|
vm.$message.error("请选择所在区域~");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|