feat: 添加镇

This commit is contained in:
2025-09-25 17:59:07 +08:00
parent 997237ca9d
commit ba8158093a
@@ -67,6 +67,7 @@ export default {
provinceId: null,// 省份ID provinceId: null,// 省份ID
cityId: null,// 城市ID cityId: null,// 城市ID
areaId: null,// 区域ID areaId: null,// 区域ID
townshipId: null,// 街道ID
address: null,// 详细地址 address: null,// 详细地址
}, },
regionShow: false, regionShow: false,
@@ -96,6 +97,7 @@ export default {
const resp = await getAddressDetail(parasm); const resp = await getAddressDetail(parasm);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
const data = resp.data; const data = resp.data;
this.form.id = id; this.form.id = id;
this.form.name = data.name;// 收货人 this.form.name = data.name;// 收货人
this.form.mobile = data.phone;// 手机号码 this.form.mobile = data.phone;// 手机号码
@@ -103,7 +105,9 @@ export default {
this.form.provinceId = data.provinceId;// 省份ID this.form.provinceId = data.provinceId;// 省份ID
this.form.cityId = data.cityId;// 城市ID this.form.cityId = data.cityId;// 城市ID
this.form.areaId = data.areaId;// 区域ID this.form.areaId = data.areaId;// 区域ID
this.form.townshipId = data.townshipId;// 街道ID
this.form.address = data.address;// this.form.address = data.address;//
const regionStr = []; const regionStr = [];
if (data.countryName) { if (data.countryName) {
regionStr.push(data.countryName); regionStr.push(data.countryName);
@@ -129,7 +133,8 @@ export default {
const province = nation && nation.length !== 0 ? await this.getRegion(nation[0].id) : []; const province = nation && nation.length !== 0 ? await this.getRegion(nation[0].id) : [];
const city = province && province.length !== 0 ? await this.getRegion(province[0].id) : []; const city = province && province.length !== 0 ? await this.getRegion(province[0].id) : [];
const area = city && city.length !== 0 ? await this.getRegion(city[0].id) : []; const area = city && city.length !== 0 ? await this.getRegion(city[0].id) : [];
this.regionColumns = [nation, province, city, area]; console.log('选择地址的弹框', nation, province, city, area,status)
this.regionColumns = [nation, province, city, area,];
} else { } else {
this.regionColumns = [[], [], [], []]; this.regionColumns = [[], [], [], []];
} }
@@ -189,12 +194,13 @@ export default {
regionId.push(item.id); regionId.push(item.id);
} }
}) })
console.log('提交地址--1',value)
this.form.regionStr = regionStr; this.form.regionStr = regionStr;
if (regionId && regionId.length !== 0) { if (regionId && regionId.length !== 0) {
this.form.countryId = regionId[0] ? regionId[0] : null; this.form.countryId = regionId[0] ? regionId[0] : null;
this.form.provinceId = regionId[1] ? regionId[1] : null; this.form.provinceId = regionId[1] ? regionId[1] : null;
this.form.cityId = regionId[2] ? regionId[2] : null; this.form.cityId = regionId[2] ? regionId[2] : null;
this.form.areaId = regionId[3] ? regionId[3] : null; this.form.townshipId = regionId[4] ? regionId[4] : null;
} }
this.regionShowCheck(false); this.regionShowCheck(false);
}, },