!69 2022-1-21 Jiamin

Merge pull request !69 from Admin/sit-jiamin-v2
This commit is contained in:
Admin 2022-01-21 08:46:44 +00:00 committed by Gitee
commit d68d933d79
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 176 additions and 72 deletions

View File

@ -3,6 +3,9 @@
margin: 0; margin: 0;
} }
@media screen and (max-width:768px){ @media screen and (max-width:768px){
.userdit{
display: none;
}
.online{ .online{
width:100%; width:100%;
background:#d7d7d7; background:#d7d7d7;
@ -114,8 +117,13 @@ color: #FFFFFF;
@media screen and (min-width: 768px) @media screen and (min-width: 768px)
{ {
.rc-max-width--xl{ .rc-max-width--xl{
margin-bottom: 80px; margin-bottom: 80px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between
} }
.rc-button{ .rc-button{
@ -123,75 +131,25 @@ display: none;
} }
.usercontend { .usercontend {
display:inline-block; display:inline-block;
width: 48%;
margin-top: 40px;
padding: 24px 20px;
} }
.usercontend{
margin-top: 40px;
}
.online{ .online{
display: none; display: none;
} }
.rc-button{ .rc-button{
display: none; display: none;
} }
.useredit{
width: 640px;
height: 166px;
background: #FFFFFF;
border: 1px solid #D7D7D7;
border-radius: 3px;
display: flex;
align-items: center;
justify-content: center;
display:inline-block;
margin-left: 35px;
img{
width: 31px;
height: 31px;
}
span{
color: #333333;
font-size: 18px;
}
.alledit{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
}
.usercontend{
.useradd{
width: 680px;
height: 164px;
background: #FFFFFF;
border-radius: 3px;
img{
width: 31px;
height: 31px;
display: block;
}
}
}
.rc-max-width--xl{ .rc-max-width--xl{
.rc-center{
margin-top: 24px;
margin-left: 24px;
}
.rc-cat{ .rc-cat{
width: 640px;
border: 1px solid #D7D7D7; border: 1px solid #D7D7D7;
border-radius: 3px; border-radius: 3px;
position: relative; position: relative;
margin-left: 40px;
height: 164px; height: 164px;
box-sizing: border-box;
padding: 20px 20px;
} }
.rc-title { .rc-title {
display: flex; display: flex;
@ -292,5 +250,39 @@ img{
} }
.userdit{
width: 45%;
height: 164px;
display: inline-block;
height: 164px;
border: 1px solid #D7D7D7;
border-radius: 3px;
margin-top: 65px;
box-sizing: border-box;
border: 1px solid #D7D7D7;
border-radius: 3px;
position: relative;
height: 164px;
box-sizing: border-box;
margin-left: 20px;
}
.alledit{
display: flex;
align-items: center;
justify-content: center;
position: relative;
height: 100%;
img{
width: 31px;
height: 31px;
}
span{
color: #333333;
font-size: 18px;
}
}
} }

View File

@ -64,6 +64,10 @@ export default {
defaultValues = this.defaultValues; defaultValues = this.defaultValues;
this.onConfirm(defaultValues); this.onConfirm(defaultValues);
} }
else{
this.defaultValues = defaultValues;
}
//Initilizing end //Initilizing end
}, },
pickValue(pickId,pickName){ pickValue(pickId,pickName){
@ -233,6 +237,16 @@ export default {
popAddress() { popAddress() {
this.show=true; this.show=true;
let _self=this; let _self=this;
if(this.defaultValues && this.defaultValues.length>0)
{
this.defaultValues.forEach(function(ele,index){
let tmpPointer=parseInt(_self.inArray(ele,_self.columns[index].values));
if(tmpPointer)
{
_self.columns[index].defaultIndex = tmpPointer;
}
});
}
//mobile //mobile
//const picker = this.selectComponent('.ts-area-picker-mobile-component'); //const picker = this.selectComponent('.ts-area-picker-mobile-component');

View File

@ -63,6 +63,9 @@ export default {
usermessage:null, usermessage:null,
dialogInfo1:false, dialogInfo1:false,
userpeople:'', userpeople:'',
provinceId:'',
cityId:'',
districtId:'',
list: [ list: [
{ {
id: 1, id: 1,
@ -121,11 +124,40 @@ export default {
}); });
return return
} }
else if(this.provinceId===''){
this.$message({
type: 'warning',
message: '请选择省区'
});
return
}
else if(this.cityId===''){
this.$message({
type: 'warning',
message: '请选择市区'
});
return
}
else if(this.districtId===''){
this.$message({
type: 'warning',
message: '请选择详细的区域'
});
return
}
else{ else{
this.editaddress(); this.editaddress();
} }
}, },
openclose(){
this.$router.push({
path: "/useraddress/openaddress",
// query: {
// id: userid,
// },
});
},
// //
@ -144,10 +176,20 @@ export default {
let data = await editaddress(useradd); let data = await editaddress(useradd);
if(data){ if(data){
console.log(data); console.log(data);
this.$message({ if(data){
this.$message({
type: 'warning', type: 'warning',
message: '地址添加成功' message: '地址添加成功'
}); });
this.$router.push({
path: "/useraddress/openaddress",
// query: {
// id: userid,
// },
});
}
} }
}, },

View File

@ -57,6 +57,9 @@ export default {
recipientPhone:'', recipientPhone:'',
recipient:'', recipient:'',
addressid:'', addressid:'',
provinceId:'',
cityId:'',
districtId:'',
defaultValues:[], defaultValues:[],
list: [ list: [
{ {
@ -83,7 +86,35 @@ export default {
}, },
methods: { methods: {
onGetMenu(values){ onGetMenu(values){
let user;
console.log(values,+'111111'); console.log(values,+'111111');
console.log(typeof(values[2]));
const objToStr = JSON.stringify(values[2]);
console.log(objToStr);
console.log(typeof(objToStr));
if(objToStr.includes('-')){
console.log("===包含符号")
let user=values[2].id;
user=user.split('-');
this.provinceId=user[0];
this.cityId=user[1];
this.districtId=user[2];
}else{
this.provinceId=values[0].id;
this.cityId=values[1].id;
this.districtId=values[2].id;
console.log("---不包含符号");
}
// let user=values[2].id;
// user=user.split('-');
console.log(this.provinceId,this.cityId,this.districtId);
},
openclose(){
this.$router.push({
path: "/useraddress/openaddress",
});
}, },
handleClose1(){ handleClose1(){
this.dialogInfo1 = false this.dialogInfo1 = false
@ -111,20 +142,41 @@ export default {
}); });
return return
} }
else if(this.provinceId===''){
this.$message({
type: 'warning',
message: '请填写省区'
});
return
}
else if(this.userpeople===''){
this.$message({
type: 'warning',
message: '请填写市区'
});
return
}
else if(this.userpeople===''){
this.$message({
type: '请填写街道',
message: '请输入姓名'
});
return
}
else{ else{
this.editaddress(); this.edupdate();
} }
}, },
// //
async editaddress(item) { async edupdate(item) {
let useradd={ let useradd={
memberId:this.userid, memberId:this.userid,
id:this.id, id:this.id,
provinceId:'',//id, provinceId:this.provinceId,//id,
cityId:'',//id, cityId:this.cityId,//id,
districtId:'',//id, districtId:this.districtId,//id,
detailAddress:this.detailAddress, // detailAddress:this.detailAddress, //
recipient:this.recipient, // recipient:this.recipient, //
recipientPhone:this.recipientPhone, // recipientPhone:this.recipientPhone, //
@ -135,6 +187,10 @@ export default {
type: 'warning', type: 'warning',
message: '地址修改成功' message: '地址修改成功'
}); });
this.$router.push({
path: "/useraddress/openaddress",
});
} }
}, },
@ -168,20 +224,20 @@ export default {
let provinceName=this.$route.query.provinceName; let provinceName=this.$route.query.provinceName;
let districtName=this.$route.query.districtName; let districtName=this.$route.query.districtName;
let cityName=this.$route.query.cityName let cityName=this.$route.query.cityName
let provinceId=this.$route.query.provinceId; this.provinceId=this.$route.query.provinceId;
let districtNameid=this.$route.query.districtId; this.districtId=this.$route.query.districtId;
let cityId=this.$route.query.cityId; this.cityId=this.$route.query.cityId;
this.defaultValues=[ this.defaultValues=[
{ {
id:provinceId, id:this.provinceId,
name:provinceName name:provinceName
}, },
{ {
id:cityId, id:this.cityId,
name:cityName name:cityName
}, },
{ {
id:districtNameid, id:this.districtId,
name:districtName name:districtName
} }
]; ];

View File

@ -46,8 +46,8 @@
</div> </div>
<div class="usercontshow useredit"> <div class="userdit" ref="marinaddress">
<div class="usercontshow alledit" @click="onAdd()"> <div class="alledit" @click="onAdd()">
<img src="../../static/images/adddress.png" alt=""> <img src="../../static/images/adddress.png" alt="">
<span>添加收货地址</span> <span>添加收货地址</span>
</div> </div>