This commit is contained in:
952108534@qq.com 2022-01-20 21:42:02 +08:00
parent ebc95312fb
commit 00ce4d7f07
3 changed files with 61 additions and 40 deletions

View File

@ -44,7 +44,11 @@ color: #FFFFFF;
} }
.rc-max-width--xl{ .rc-max-width--xl{
padding: 24px 20px 24px 20px; padding: 0px 20px 24px 20px;
min-height: 60vh;
.rc-cat{
margin-top: 20px;
}
.rc-title { .rc-title {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="rc-max-width--xl rc-address"> <div class="rc-max-width--xl rc-address">
<span>所在地区:</span> <span>所在地区:</span>
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput> <addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1" :defaultValues="defaultValues"></addressInput>
</div> </div>
<div class="rc-max-width--xl rc-useaddress"> <div class="rc-max-width--xl rc-useaddress">
<span>详细地址:</span> <span>详细地址:</span>
@ -52,10 +52,12 @@ export default {
userid: null, userid: null,
dialogInfo1:false, dialogInfo1:false,
usermessage:null, usermessage:null,
useradrname:[],
detailAddress:'', detailAddress:'',
recipientPhone:'', recipientPhone:'',
recipient:'', recipient:'',
addressid:'', addressid:'',
defaultValues:[],
list: [ list: [
{ {
id: 1, id: 1,
@ -162,21 +164,36 @@ export default {
MyFooter, MyFooter,
addressInput addressInput
}, },
created(){
let provinceName=this.$route.query.provinceName;
let districtName=this.$route.query.districtName;
let cityName=this.$route.query.cityName
let provinceId=this.$route.query.provinceId;
let districtNameid=this.$route.query.districtId;
let cityId=this.$route.query.cityId;
debugger;
this.defaultValues=[
{
id:provinceId,
name:provinceName
},
{
id:cityId,
name:cityName
},
{
id:districtNameid,
name:districtName
}
];
},
mounted() { mounted() {
// if(this.$route.query.id){ this.userid = JSON.parse(localStorage.getItem("userInfo")).data.id;
this.userid = JSON.parse(localStorage.getItem("userInfo")).data.id; this.recipient=this.$route.query.recipient
this.recipient=this.$route.query.recipient this.recipientPhone=this.$route.query.recipientPhone
this.recipientPhone=this.$route.query.recipientPhone this.detailAddress=this.$route.query.detailAddress
this.detailAddress=this.$route.query.detailAddress this.id=this.$route.query.id;
this.id=this.$route.query.id;
console.log(this.recipient,this.recipientPhone,this.detailAddress, this.id)
// }
//
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
// this.editaddress(this.usermessage);
// this.userid = this.usermessage.data.id;
}, },
}; };
</script> </script>

View File

@ -52,13 +52,14 @@
<span>添加收货地址</span> <span>添加收货地址</span>
</div> </div>
</div> </div>
<div class="rc-button">
</div>
<div class="rc-button">
<div class="rc-footbutton" @click="onAdd()"> <div class="rc-footbutton" @click="onAdd()">
<span>新增收货地址</span> <span>新增收货地址</span>
</div> </div>
</div> </div>
</div>
<MyFooter></MyFooter> <MyFooter></MyFooter>
</div> </div>
</template> </template>
@ -73,27 +74,10 @@ export default {
chosenAddressId: "1", chosenAddressId: "1",
checked: true, checked: true,
userid: null, userid: null,
userlist:[],
usermessage:null, usermessage:null,
list: [ list: [
{
id: 1,
name: "张三",
tel: "13000000000",
address: "浙江省杭州市西湖区文三路 138 号",
isDefault: true,
},
{
id: 2,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
{
id: 3,
name: "李四",
tel: "1310000000",
address: "浙江省杭州市拱墅区莫干山路 50 号",
},
], ],
}; };
}, },
@ -106,22 +90,32 @@ export default {
}else{ }else{
item.isDefault=false; item.isDefault=false;
} }
this.editupdate(this.userid,item.id,item.isDefault) this.editupdate(this.userid,item.id,item.isDefault)
this.editaddress(); setTimeout(() => {
this.editaddress();
}, 200);
//
}, },
onEdit(item, index) { onEdit(item, index) {
// let userid = item.id; // let userid = item.id;
console.log(item); console.log(item);
// debugger // debugger
this.$router.push({ this.$router.push({
path: "/useraddress/editaddress", path: "/useraddress/editaddress",
query: { query: {
recipient: item.recipient, recipient: item.recipient,
recipientPhone:item.recipientPhone, recipientPhone:item.recipientPhone,
detailAddress:item.detailAddress, detailAddress:item.detailAddress,
id:item.id id:item.id,
provinceName:item.provinceName,
districtName:item.cityName,
cityName:item.districtName,
provinceId:item.provinceId,
districtId:item.districtId,
cityId:item.cityId,
}, },
}); });
}, },
@ -145,6 +139,12 @@ export default {
} }
let data = await editupdate(useradd); let data = await editupdate(useradd);
if(data){
this.$message({
type: 'warning',
message: '更改成功'
});
}
// if(data){ // if(data){
// this.editaddress(); // this.editaddress();
// } // }