mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 02:36:39 +08:00
更改
This commit is contained in:
parent
bcc04c1d11
commit
ef1120ec7c
212
rc-busness/assets/css/addaddress.less
Normal file
212
rc-busness/assets/css/addaddress.less
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width:768px){
|
||||||
|
.usercontend{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
.rc-useaddress{
|
||||||
|
textarea{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.rc-button{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 14px;
|
||||||
|
width: 100%;
|
||||||
|
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
height: 80px;
|
||||||
|
align-items: center;
|
||||||
|
padding:0 20px 0 20px;
|
||||||
|
span
|
||||||
|
{
|
||||||
|
width: 160px;
|
||||||
|
height: 48px;
|
||||||
|
border: 2px solid #E2001A;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #E2001A;
|
||||||
|
}
|
||||||
|
em{
|
||||||
|
font-style: normal;
|
||||||
|
width: 164px;
|
||||||
|
height: 48px;
|
||||||
|
background: #E2001A;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.rc-max-width--xl{
|
||||||
|
h2{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.rc-max-width--xl{
|
||||||
|
margin-top: 16px;
|
||||||
|
input{
|
||||||
|
width: 258px;
|
||||||
|
height: 34px;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #808285;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 22%;
|
||||||
|
text-align: center;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
.rc-people{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
span{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// .rc-phone{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .rc-address{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .rc-useaddress{
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 769px)
|
||||||
|
{
|
||||||
|
.usercontend{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
flex-direction: column;
|
||||||
|
.rc-button{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 14px;
|
||||||
|
width: 100%;
|
||||||
|
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
height: 80px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
padding:0 20px 0 20px;
|
||||||
|
span
|
||||||
|
{
|
||||||
|
width: 160px;
|
||||||
|
height: 48px;
|
||||||
|
border: 2px solid #E2001A;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #E2001A;
|
||||||
|
}
|
||||||
|
em{
|
||||||
|
font-style: normal;
|
||||||
|
width: 164px;
|
||||||
|
height: 48px;
|
||||||
|
background: #E2001A;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
h2{
|
||||||
|
font-size: 26px;
|
||||||
|
color: #333333;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.rc-useaddress{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
textarea{
|
||||||
|
width: 680px;
|
||||||
|
height: 118px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border: 1px solid #808285;
|
||||||
|
opacity: 1;
|
||||||
|
border-radius: 0px;
|
||||||
|
padding-top: 12px;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userinput{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.rc-max-width--xl{
|
||||||
|
margin-top: 16px;
|
||||||
|
input{
|
||||||
|
width: 680px;
|
||||||
|
height: 45px;
|
||||||
|
border: 1px solid #808285;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-left: 2px;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 10%;
|
||||||
|
text-align: center;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
.rc-people{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// .rc-phone{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .rc-address{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .rc-useaddress{
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -276,7 +276,6 @@ margin-top: 8px;
|
|||||||
padding-right: 17px;
|
padding-right: 17px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
}
|
}
|
||||||
.ts-standard-btn{
|
.ts-standard-btn{
|
||||||
|
|
||||||
|
89
rc-busness/assets/css/editaddress.less
Normal file
89
rc-busness/assets/css/editaddress.less
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
@media screen and (max-width:768px){
|
||||||
|
.rc-button{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 14px;
|
||||||
|
width: 100%;
|
||||||
|
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
height: 80px;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
padding:0 20px 0 20px;
|
||||||
|
span
|
||||||
|
{
|
||||||
|
width: 160px;
|
||||||
|
height: 48px;
|
||||||
|
border: 2px solid #E2001A;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #E2001A;
|
||||||
|
}
|
||||||
|
em{
|
||||||
|
font-style: normal;
|
||||||
|
width: 164px;
|
||||||
|
height: 48px;
|
||||||
|
background: #E2001A;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.rc-max-width--xl{
|
||||||
|
margin-top: 16px;
|
||||||
|
input{
|
||||||
|
width: 258px;
|
||||||
|
height: 34px;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #808285;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 22%;
|
||||||
|
text-align: center;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
.rc-people{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
span{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// .rc-phone{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .rc-address{
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .rc-useaddress{
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 769px)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -26,10 +26,7 @@ span{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.rc-usermain{
|
.rc-max-width--xl{
|
||||||
width: 92%;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
ul{
|
ul{
|
||||||
height: 70px;
|
height: 70px;
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Myheader></Myheader>
|
<Myheader></Myheader>
|
||||||
|
<div class="rc-top"></div>
|
||||||
<div class="rc-usermain ">
|
<div class="rc-max-width--xl rc-main ">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(item,index) in userrecord" :key="index">
|
<li v-for="(item,index) in userrecord" :key="index">
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
@ -20,13 +20,13 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rc-button">
|
<!-- <div class="rc-button">
|
||||||
<div class="rc-order">
|
<div class="rc-order">
|
||||||
<span>积分兑换</span>
|
<span>积分兑换</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -115,6 +115,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import url("../../assets/css/integral.less");
|
@import url("../../assets/css/integral.less");
|
||||||
|
@import url("@/assets/css/global.less");
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -342,9 +342,7 @@ obligation(item,index){
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
if(item.title=='收货地址'){
|
if(item.title=='收货地址'){
|
||||||
this.$router.push({
|
this.$router.push({ name: "useraddress-openaddress",})
|
||||||
path: `/useraddress/openaddress/`
|
|
||||||
})
|
|
||||||
console.log('这是地址的跳转');
|
console.log('这是地址的跳转');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -357,7 +355,7 @@ this.$router.push({
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: `/personal/discount/`
|
path: `/personal/discount/`
|
||||||
})
|
})
|
||||||
console.log('这是地址的跳转');
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,81 +1,137 @@
|
|||||||
<template>
|
<template>
|
||||||
<van-address-edit
|
<div>
|
||||||
:area-list="areaList"
|
<Myheader></Myheader>
|
||||||
show-postal
|
<div class="rc-top"></div>
|
||||||
show-delete
|
<div class="usercontend">
|
||||||
show-set-default
|
<div class="rc-max-width--xl">
|
||||||
show-search-result
|
<h2>新增收货地址</h2>
|
||||||
:search-result="searchResult"
|
<div class="rc-max-width--xl rc-people">
|
||||||
:area-columns-placeholder="['请选择', '请选择', '请选择']"
|
<span>收货人:</span>
|
||||||
@save="onSave"
|
<input type="text" placeholder="请输入收货人姓名">
|
||||||
@delete="onDelete"
|
</div>
|
||||||
@change-detail="onChangeDetail"
|
<div class="rc-max-width--xl rc-phone">
|
||||||
/>
|
<span>手机号码:</span>
|
||||||
|
<input type="text" placeholder="请输入11位手机号码">
|
||||||
|
</div>
|
||||||
|
<div class="rc-max-width--xl rc-address">
|
||||||
|
<span>所在地区:</span>
|
||||||
|
<input type="text" placeholder="请选择所在地区">
|
||||||
|
</div>
|
||||||
|
<div class="rc-max-width--xl rc-useaddress">
|
||||||
|
<span>详细地址:</span>
|
||||||
|
<input type="text" placeholder="小区、门牌号等" class="userinput">
|
||||||
|
<textarea rows="10" cols="30" placeholder="请输入详细地址">
|
||||||
|
|
||||||
|
</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="rc-button">
|
||||||
|
<span @click="openclose()">取消</span>
|
||||||
|
<em @click="openclose()">确认</em>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="rc-button">
|
||||||
|
<div class="rc-footbutton" @click="onAdd()">
|
||||||
|
<span>新增收货地址</span>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<MyFooter></MyFooter>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { editaddress } from "../../ajax/getData";
|
|
||||||
import { Toast } from 'vant';
|
import Myheader from '~/components/header.vue'
|
||||||
import { areaList } from '@vant/area-data';
|
import MyFooter from '~/components/rc-footer.vue'
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data() {
|
||||||
return{
|
return {
|
||||||
areaList,
|
chosenAddressId: "1",
|
||||||
searchResult: [],
|
checked: true,
|
||||||
userid:null,
|
userid: null,
|
||||||
addressdetail:'',
|
usermessage:null,
|
||||||
}
|
list: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "张三",
|
||||||
|
tel: "13000000000",
|
||||||
|
address: "浙江省杭州市西湖区文三路 138 号",
|
||||||
|
isDefault: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: "李四",
|
||||||
|
tel: "1310000000",
|
||||||
|
address: "浙江省杭州市拱墅区莫干山路 50 号",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: "李四",
|
||||||
|
tel: "1310000000",
|
||||||
|
address: "浙江省杭州市拱墅区莫干山路 50 号",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
async onSave(content) {
|
onEdit(item, index) {
|
||||||
// Toast('save');
|
// let userid = item.id;
|
||||||
console.log(content);
|
console.log(item);
|
||||||
let recipient=content.name;
|
this.$router.push({
|
||||||
let tel=content.tel;
|
path: "/useraddress/editaddress",
|
||||||
let provinceId=Number(content.areaCode.substring(0,2)+'0000')//省份id
|
query: {
|
||||||
let cityId=Number(content.areaCode.substring(0,4)+'00') //城市id
|
id: item,
|
||||||
let districtId=Number(content.areaCode);//区域编码
|
},
|
||||||
console.log(provinceId,cityId,districtId);
|
});
|
||||||
console.log(content.areaCode.substring(0,2)+'0000');//城市编码
|
|
||||||
console.log(content.areaCode.substring(0,4)+'00'); //市区id
|
|
||||||
console.log(content.areaCode) //区域编码
|
|
||||||
//id 详细地址 /收货人姓名 电话号码 省份id/城市id/区域编码
|
|
||||||
let data = await editaddress(this.userid,this.addressdetail,recipient,tel,provinceId,cityId,districtId);
|
|
||||||
|
|
||||||
if(data){
|
|
||||||
this.$message({
|
|
||||||
type: 'warning',
|
|
||||||
message: '地址保存成功'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
console.log(data);
|
|
||||||
},
|
},
|
||||||
onDelete() {
|
onAdd(item, index) {
|
||||||
|
// let userid = item.id;
|
||||||
Toast('delete');
|
// console.log(item);
|
||||||
|
this.$router.push({
|
||||||
|
path: "/useraddress/addaddress",
|
||||||
|
// query: {
|
||||||
|
// id: userid,
|
||||||
|
// },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onChangeDetail(val){
|
|
||||||
this.addressdetail=val;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//删除地址
|
||||||
|
// async userdelete(item) {
|
||||||
|
// console.log(item.memberId);
|
||||||
|
// let data = await editdelete(this.userid, item.id);
|
||||||
|
// this.editaddress(this.usermessage);
|
||||||
|
// console.log(data);
|
||||||
|
// },
|
||||||
|
|
||||||
|
//查询人的所有地址
|
||||||
|
// async editaddress(user) {
|
||||||
|
// user.data.id=844350
|
||||||
|
// let data = await selectaddress(user.data.id);
|
||||||
|
// this.list=data.data;
|
||||||
|
// console.log(this.list);
|
||||||
|
// console.log(data);
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
mounted(){
|
components: {
|
||||||
let user= JSON.parse(localStorage.getItem("userInfo"));
|
Myheader,
|
||||||
// this.userid=user.data.id;
|
MyFooter
|
||||||
this.userid=3242
|
|
||||||
|
|
||||||
},
|
|
||||||
components:{
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
}
|
//地址的查询
|
||||||
|
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||||
|
// this.editaddress(this.usermessage);
|
||||||
|
// this.userid = this.usermessage.data.id;
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="less" scoped >
|
||||||
|
@import url("../../assets/css/global.less");
|
||||||
|
@import url("../../assets/css/addaddress.less");
|
||||||
</style>
|
</style>
|
@ -1,99 +1,131 @@
|
|||||||
<template>
|
<template>
|
||||||
<van-address-edit
|
<div>
|
||||||
:area-list="areaList"
|
<Myheader></Myheader>
|
||||||
show-postal
|
<div class="rc-top"></div>
|
||||||
show-set-default
|
|
||||||
show-search-result
|
|
||||||
:search-result="searchResult"
|
|
||||||
:address-info="AddressInfo"
|
|
||||||
:area-columns-placeholder="['请选择', '请选择', '请选择']"
|
|
||||||
@save="onSave"
|
|
||||||
@change-detail="onChangeDetail"
|
|
||||||
>
|
|
||||||
<!-- <div class="main">
|
|
||||||
<span>我的</span>
|
|
||||||
|
|
||||||
</div> -->
|
<div class="rc-max-width--xl rc-main">
|
||||||
|
<div class="rc-max-width--xl rc-people">
|
||||||
|
<span>收货人:</span>
|
||||||
|
<input type="text" placeholder="李某某">
|
||||||
|
</div>
|
||||||
|
<div class="rc-max-width--xl rc-phone">
|
||||||
|
<span>手机号码:</span>
|
||||||
|
<input type="text" placeholder="15279944631">
|
||||||
|
</div>
|
||||||
|
<div class="rc-max-width--xl rc-address">
|
||||||
|
<span>所在地区:</span>
|
||||||
|
<input type="text" placeholder="请选择所在地区">
|
||||||
|
</div>
|
||||||
|
<div class="rc-max-width--xl rc-useaddress">
|
||||||
|
<span>详细地址:</span>
|
||||||
|
<input type="text" placeholder="天河客运站">
|
||||||
|
</div>
|
||||||
|
|
||||||
</van-address-edit>
|
</div>
|
||||||
|
<!-- <div class="rc-button">
|
||||||
|
<div class="rc-footbutton" @click="onAdd()">
|
||||||
|
<span>新增收货地址</span>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
<div class="rc-button">
|
||||||
|
<span @click="openclose()">取消</span>
|
||||||
|
<em @click="openclose()">确认</em>
|
||||||
|
</div>
|
||||||
|
<!-- <MyFooter></MyFooter> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from 'vant';
|
|
||||||
import { areaList } from '@vant/area-data';
|
import Myheader from '~/components/header.vue'
|
||||||
import { editupdate } from "../../ajax/getData";
|
import MyFooter from '~/components/rc-footer.vue'
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data() {
|
||||||
return{
|
return {
|
||||||
areaList,
|
chosenAddressId: "1",
|
||||||
searchResult: [],
|
checked: true,
|
||||||
AddressInfo:{//收货人信息初始值
|
userid: null,
|
||||||
name:'',//姓名
|
usermessage:null,
|
||||||
tel:'',//电话
|
list: [
|
||||||
province:'',//省份
|
{
|
||||||
city:'',//城市
|
id: 1,
|
||||||
country:'',//区县
|
name: "张三",
|
||||||
address:'',
|
tel: "13000000000",
|
||||||
areaCode:'',//地址code:ID
|
address: "浙江省杭州市西湖区文三路 138 号",
|
||||||
addressDetail:'',//详细地址
|
isDefault: true,
|
||||||
isDefault:false,//是否选择默认
|
},
|
||||||
},
|
{
|
||||||
|
id: 2,
|
||||||
}
|
name: "李四",
|
||||||
|
tel: "1310000000",
|
||||||
|
address: "浙江省杭州市拱墅区莫干山路 50 号",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: "李四",
|
||||||
|
tel: "1310000000",
|
||||||
|
address: "浙江省杭州市拱墅区莫干山路 50 号",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
|
onEdit(item, index) {
|
||||||
valf(){
|
// let userid = item.id;
|
||||||
setTimeout(()=>{
|
console.log(item);
|
||||||
let s=this.$route.query.id;
|
this.$router.push({
|
||||||
console.log(s);
|
path: "/useraddress/editaddress",
|
||||||
this.AddressInfo.name= s.recipient,
|
query: {
|
||||||
this.AddressInfo.tel=s.recipientPhone,
|
id: item,
|
||||||
this.AddressInfo.province=s.name
|
},
|
||||||
this.AddressInfo.city=s.name
|
});
|
||||||
this.AddressInfo.addressDetail=s.detailAddress
|
|
||||||
this.AddressInfo.isDefault=s.isDefault,
|
|
||||||
this.AddressInfo.country='江西省'
|
|
||||||
this.AddressInfo.address='江西省'
|
|
||||||
|
|
||||||
},100)
|
|
||||||
},
|
|
||||||
async onSave(content) {
|
|
||||||
let data = await editupdate(this.tel);
|
|
||||||
console.log(data);
|
|
||||||
console.log(content);
|
|
||||||
// Toast('save');
|
|
||||||
console.log(content.areaCode.substring(0,2)+'0000');//城市编码
|
|
||||||
console.log(content.areaCode.substring(0,4)+'00'); //市区id
|
|
||||||
console.log(content.areaCode) //区域编码
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onDelete() {
|
onAdd(item, index) {
|
||||||
Toast('delete');
|
// let userid = item.id;
|
||||||
|
// console.log(item);
|
||||||
|
this.$router.push({
|
||||||
|
path: "/useraddress/addaddress",
|
||||||
|
// query: {
|
||||||
|
// id: userid,
|
||||||
|
// },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onChangeDetail(val){
|
|
||||||
|
|
||||||
console.log(this.searchResult);
|
|
||||||
console.log(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
this.valf();
|
|
||||||
this.searchResult = [
|
|
||||||
{
|
|
||||||
name: '黄龙万科中心',
|
|
||||||
address: '杭州市西湖区',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
components:{
|
|
||||||
|
|
||||||
|
|
||||||
|
//删除地址
|
||||||
|
// async userdelete(item) {
|
||||||
|
// console.log(item.memberId);
|
||||||
|
// let data = await editdelete(this.userid, item.id);
|
||||||
|
// this.editaddress(this.usermessage);
|
||||||
|
// console.log(data);
|
||||||
|
// },
|
||||||
|
|
||||||
|
//查询人的所有地址
|
||||||
|
// async editaddress(user) {
|
||||||
|
// user.data.id=844350
|
||||||
|
// let data = await selectaddress(user.data.id);
|
||||||
|
// this.list=data.data;
|
||||||
|
// console.log(this.list);
|
||||||
|
// console.log(data);
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
Myheader,
|
||||||
|
MyFooter,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
}
|
//地址的查询
|
||||||
|
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||||
|
// this.editaddress(this.usermessage);
|
||||||
|
// this.userid = this.usermessage.data.id;
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="less" scoped >
|
||||||
|
@import url("../../assets/css/global.less");
|
||||||
|
@import url("../../assets/css/editaddress.less");
|
||||||
</style>
|
</style>
|
@ -1,27 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Myheader></Myheader>
|
<Myheader></Myheader>
|
||||||
<div class="usermain">
|
<div class="rc-top"></div>
|
||||||
<div class="rc-main" v-for="(item, index) in list" :key="index">
|
<div class="usercontend">
|
||||||
|
<div class="rc-max-width--xl rc-main">
|
||||||
|
<div class="rc-cat" v-for="(item, index) in list" :key="index">
|
||||||
<div class="rc-center">
|
<div class="rc-center">
|
||||||
<div class="rc-header">
|
<div class=" rc-title">
|
||||||
<em>
|
<em>
|
||||||
{{ item.recipient }}
|
{{ item.name }}
|
||||||
</em>
|
</em>
|
||||||
<span>
|
<span>
|
||||||
{{ item.recipientPhone }}
|
{{ item.tel }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-address">
|
<div class="rc-address">
|
||||||
<span>
|
<span>
|
||||||
{{ item.detailAddress }}
|
{{ item.address }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-footer">
|
<div class="rc-footer">
|
||||||
<div class="rc-foot">
|
<div class="rc-foot">
|
||||||
|
<img src="../../assets/image/userselect.png" alt="">
|
||||||
<span>设置为默认收货地址</span>
|
<span>设置为默认收货地址</span>
|
||||||
|
|
||||||
<!-- <van-switch v-model="checked" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-right">
|
<div class="rc-right">
|
||||||
<span @click="onEdit(item, index)">编辑</span>
|
<span @click="onEdit(item, index)">编辑</span>
|
||||||
@ -32,7 +34,14 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="usercontend useradd">
|
||||||
|
<img src="../../assets/image/userselect.png" alt="">
|
||||||
|
<span>添加收货地址</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="rc-button">
|
<div class="rc-button">
|
||||||
<div class="rc-footbutton" @click="onAdd()">
|
<div class="rc-footbutton" @click="onAdd()">
|
||||||
<span>新增收货地址</span>
|
<span>新增收货地址</span>
|
||||||
@ -42,11 +51,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { areaList } from "@vant/area-data";
|
import { areaList } from '@vant/area-data';
|
||||||
import { selectaddress } from "../../ajax/getData";
|
import Myheader from '~/components/header.vue'
|
||||||
import { editdelete } from "../../ajax/getData";
|
|
||||||
import Myheader from "~/components/header.vue";
|
|
||||||
import { Toast } from "vant";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -79,13 +85,8 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onAdd() {
|
|
||||||
Toast("新增地址");
|
|
||||||
|
|
||||||
this.$router.push({ path: "/useraddress/addaddress" });
|
|
||||||
},
|
|
||||||
onEdit(item, index) {
|
onEdit(item, index) {
|
||||||
let userid = item.id;
|
// let userid = item.id;
|
||||||
console.log(item);
|
console.log(item);
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: "/useraddress/editaddress",
|
path: "/useraddress/editaddress",
|
||||||
@ -94,201 +95,50 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//删除地址
|
onAdd(item, index) {
|
||||||
async userdelete(item) {
|
// let userid = item.id;
|
||||||
console.log(item.memberId);
|
// console.log(item);
|
||||||
let data = await editdelete(this.userid, item.id);
|
this.$router.push({
|
||||||
this.editaddress(this.usermessage);
|
path: "/useraddress/addaddress",
|
||||||
console.log(data);
|
// query: {
|
||||||
|
// id: userid,
|
||||||
|
// },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//删除地址
|
||||||
|
// async userdelete(item) {
|
||||||
|
// console.log(item.memberId);
|
||||||
|
// let data = await editdelete(this.userid, item.id);
|
||||||
|
// this.editaddress(this.usermessage);
|
||||||
|
// console.log(data);
|
||||||
|
// },
|
||||||
|
|
||||||
//查询人的所有地址
|
//查询人的所有地址
|
||||||
async editaddress(user) {
|
// async editaddress(user) {
|
||||||
user.data.id=844350
|
// user.data.id=844350
|
||||||
let data = await selectaddress(user.data.id);
|
// let data = await selectaddress(user.data.id);
|
||||||
this.list=data.data;
|
// this.list=data.data;
|
||||||
console.log(this.list);
|
// console.log(this.list);
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Myheader,
|
Myheader
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
//地址的查询
|
//地址的查询
|
||||||
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||||
this.editaddress(this.usermessage);
|
// this.editaddress(this.usermessage);
|
||||||
this.userid = this.usermessage.data.id;
|
// this.userid = this.usermessage.data.id;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped >
|
<style lang="less" scoped >
|
||||||
.rc-main {
|
@import url("../../assets/css/global.less");
|
||||||
width: 93%;
|
@import url("../../assets/css/openaddress.less");
|
||||||
margin: 0 auto;
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
//手机端
|
|
||||||
@media screen and(min-width: 320px) and(max-width:768px) {
|
|
||||||
.rc-button {
|
|
||||||
height: 80px;
|
|
||||||
background: #ffffff;
|
|
||||||
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
|
|
||||||
opacity: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.rc-footbutton {
|
|
||||||
width: 164px;
|
|
||||||
height: 48px;
|
|
||||||
border: 2px solid #e2001a;
|
|
||||||
opacity: 1;
|
|
||||||
border-radius: 30px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #e2001a;
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
color: white;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.rc-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: #333333;
|
|
||||||
em {
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.rc-address {
|
|
||||||
margin-top: 8px;
|
|
||||||
text-overflow: -o-ellipsis-lastline;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
.rc-footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
margin-top: 8px;
|
|
||||||
.rc-right {
|
|
||||||
span {
|
|
||||||
border-bottom: 1px solid #666666;
|
|
||||||
}
|
|
||||||
span:first-child {
|
|
||||||
margin-right: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//pc端
|
|
||||||
@media screen and (min-width: 768px) and (max-width: 1920px) {
|
|
||||||
.usermain{
|
|
||||||
|
|
||||||
width: 90%;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.rc-main{
|
|
||||||
width: 45%;
|
|
||||||
height: 164px;
|
|
||||||
margin-top: 60px;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border: 1px solid #D7D7D7;
|
|
||||||
opacity: 1;
|
|
||||||
border-radius: 3px;
|
|
||||||
margin-left: 40px;
|
|
||||||
float: left;
|
|
||||||
.rc-center{
|
|
||||||
margin-top: 24px;
|
|
||||||
margin-left: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.rc-button {
|
|
||||||
height: 80px;
|
|
||||||
background: #ffffff;
|
|
||||||
box-shadow: 0px -3px 6px rgba(0, 0, 0, 0.1);
|
|
||||||
opacity: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
.rc-footbutton {
|
|
||||||
width: 164px;
|
|
||||||
height: 48px;
|
|
||||||
border: 2px solid #e2001a;
|
|
||||||
opacity: 1;
|
|
||||||
border-radius: 30px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #e2001a;
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
color: white;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.rc-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: #333333;
|
|
||||||
em {
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.rc-address {
|
|
||||||
margin-top: 8px;
|
|
||||||
text-overflow: -o-ellipsis-lastline;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
.rc-footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
margin-top: 8px;
|
|
||||||
.rc-right {
|
|
||||||
span {
|
|
||||||
border-bottom: 1px solid #666666;
|
|
||||||
}
|
|
||||||
span:first-child {
|
|
||||||
margin-right: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user