mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-01 17:56:39 +08:00
地址以及数据
This commit is contained in:
parent
3a954530d7
commit
1059e75bfe
@ -517,6 +517,7 @@ export const goodsmessage = (productCode) => {
|
||||
|
||||
//地址的添加 //id/详细地址/ 收货人姓名/收货人电话号码/省份id/城市id/区域编码
|
||||
export const editaddress = (memberId, detailAddress,recipient,tel,provinceId,cityId,districtId) => {
|
||||
|
||||
var data = {
|
||||
memberId:844350,
|
||||
provinceId:25,
|
||||
@ -528,7 +529,7 @@ export const goodsmessage = (productCode) => {
|
||||
zipCode:'214423',
|
||||
default:false,
|
||||
}
|
||||
return fetch('memberAddress?type=add', data, 'POST' )
|
||||
return fetch('memberAddress?type=add', memberId, 'POST' )
|
||||
}
|
||||
|
||||
//删除
|
||||
@ -541,21 +542,13 @@ export const goodsmessage = (productCode) => {
|
||||
}
|
||||
|
||||
//地址的编辑
|
||||
export const editupdate = (mobile, pet,address) => {
|
||||
var data = {
|
||||
|
||||
memberId:'3242',
|
||||
id:'620111',
|
||||
provinceId:'',
|
||||
cityId:'',
|
||||
districtId:'',
|
||||
detailAddress:'江西省萍乡市',
|
||||
recipient:'刘佳敏',
|
||||
recipientPhone:'13407998521',
|
||||
zipCode:'',
|
||||
isDefault:'',
|
||||
}
|
||||
return fetch('memberAddress?type=update', data, 'POST' )
|
||||
export const editupdate = (userid,) => {
|
||||
// var data = {
|
||||
// memberId:userid,
|
||||
// id:id,
|
||||
// isDefault:isDefault,
|
||||
// }
|
||||
return fetch('memberAddress?type=update', userid, 'POST' )
|
||||
}
|
||||
|
||||
//修改密码
|
||||
|
@ -2,50 +2,51 @@
|
||||
|
||||
|
||||
@media screen and (max-width:768px){
|
||||
.usercontend{
|
||||
.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;
|
||||
}
|
||||
}
|
||||
.usercontend{
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
min-height: 70vh;
|
||||
.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;
|
||||
@ -55,7 +56,7 @@
|
||||
}
|
||||
|
||||
.rc-max-width--xl{
|
||||
margin-top: 16px;
|
||||
padding: 24px 20px 0 20px;
|
||||
input{
|
||||
width: 258px;
|
||||
height: 34px;
|
||||
@ -100,6 +101,40 @@
|
||||
|
||||
@media screen and (min-width: 769px)
|
||||
{
|
||||
.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;
|
||||
}
|
||||
}
|
||||
.usercontend{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -197,12 +232,11 @@
|
||||
// .rc-phone{
|
||||
|
||||
// }
|
||||
// .rc-address{
|
||||
.rc-address{
|
||||
position: relative;
|
||||
|
||||
// }
|
||||
// .rc-useaddress{
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
|
||||
|
||||
@media screen and (max-width:768px){
|
||||
.rc-button{
|
||||
display: flex;
|
||||
@ -7,8 +10,6 @@
|
||||
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
|
||||
{
|
||||
@ -35,8 +36,27 @@
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
.usercontend{
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
min-height: 70vh;
|
||||
.rc-useaddress{
|
||||
textarea{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.rc-max-width--xl{
|
||||
h2{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.rc-max-width--xl{
|
||||
margin-top: 16px;
|
||||
padding: 24px 20px 0 20px;
|
||||
input{
|
||||
width: 258px;
|
||||
height: 34px;
|
||||
@ -61,8 +81,6 @@
|
||||
span{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// .rc-phone{
|
||||
|
||||
@ -82,8 +100,147 @@
|
||||
}
|
||||
|
||||
@media screen and (min-width: 769px)
|
||||
{
|
||||
{
|
||||
.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;
|
||||
}
|
||||
}
|
||||
.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{
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -3,8 +3,6 @@
|
||||
.rc-margin-bottom--lg{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width:768px){
|
||||
.online{
|
||||
width:100%;
|
||||
@ -61,9 +59,7 @@ color: #FFFFFF;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
.rc-center{
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -112,17 +108,19 @@ color: #FFFFFF;
|
||||
|
||||
}
|
||||
|
||||
@media screen and (min-width: 769px)
|
||||
@media screen and (min-width: 768px)
|
||||
|
||||
{
|
||||
.rc-max-width--xl{
|
||||
margin-bottom: 80px;
|
||||
}
|
||||
.rc-button{
|
||||
|
||||
display: none;
|
||||
}
|
||||
.usercontend {
|
||||
display:inline-block;
|
||||
}
|
||||
.usercontshow{
|
||||
.rc-button{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.usercontend{
|
||||
margin-top: 40px;
|
||||
@ -134,15 +132,17 @@ color: #FFFFFF;
|
||||
display: none;
|
||||
}
|
||||
.useredit{
|
||||
width: 680px;
|
||||
height: 164px;
|
||||
width: 640px;
|
||||
height: 166px;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #D7D7D7;
|
||||
opacity: 1;
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display:inline-block;
|
||||
margin-left: 35px;
|
||||
|
||||
img{
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
@ -153,6 +153,13 @@ span{
|
||||
font-size: 18px;
|
||||
|
||||
}
|
||||
.alledit{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
.usercontend{
|
||||
.useradd{
|
||||
@ -210,6 +217,7 @@ img{
|
||||
top: 24px;
|
||||
span {
|
||||
border-bottom: 1px solid #666666;
|
||||
cursor: pointer;
|
||||
}
|
||||
span:first-child {
|
||||
margin-right: 16px;
|
||||
@ -235,32 +243,7 @@ img{
|
||||
|
||||
|
||||
.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%;
|
||||
}
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
.rc-header {
|
||||
display: flex;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="ts-area-picker-container">
|
||||
<input class="ts-area-picker-value-displayer" placeholder="请选择收货地址" @focus="initAddress" v-model="displayValue"></input>
|
||||
<input class="ts-area-picker-value-displayer" @focus="initAddress" v-model="displayValue" placeholder="请选择所在地区"></input>
|
||||
<input type="hidden" :value="returnValue">
|
||||
|
||||
<div class="ts-area-picker-desktop" v-if="show">
|
||||
@ -255,7 +255,7 @@ export default {
|
||||
}
|
||||
this.curDisplayingCol=filteredData;
|
||||
|
||||
areaTabLi.forEach(function(ele,index){
|
||||
areaTabLi.forEach(function(ele,index){
|
||||
if(tabIndex==index){
|
||||
ele.classList.add('active');
|
||||
}
|
||||
@ -277,7 +277,9 @@ export default {
|
||||
<style lang="less" scoped>
|
||||
.ts-area-picker-container{display:inline-block;}
|
||||
.ts-area-picker-value-displayer{
|
||||
width:40rem;
|
||||
width:42.5rem;
|
||||
height: 2.81rem;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
.ts-area-picker-tmp-value{
|
||||
border-bottom:1px solid #D7D7D7;
|
||||
@ -401,6 +403,17 @@ export default {
|
||||
.ts-area-picker-desktop{
|
||||
display:none;
|
||||
}
|
||||
.ts-area-picker-value-displayer{
|
||||
width: 258px;
|
||||
height: 34px;
|
||||
border: none;
|
||||
border-bottom: 1px
|
||||
solid #808285;
|
||||
color: #999999;
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width:769px)
|
||||
{
|
||||
|
@ -7,32 +7,34 @@
|
||||
<h2>新增收货地址</h2>
|
||||
<div class="rc-max-width--xl rc-people">
|
||||
<span>收货人:</span>
|
||||
<input type="text" placeholder="请输入收货人姓名">
|
||||
<input type="text" placeholder="请输入收货人姓名" v-model="userpeople">
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-phone">
|
||||
<span>手机号码:</span>
|
||||
<input type="text" placeholder="请输入11位手机号码">
|
||||
<input type="text" placeholder="请输入11位手机号码" v-model="tel" :error-message="usertel">
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-address">
|
||||
<span>所在地区:</span>
|
||||
<input type="text" placeholder="请选择所在地区">
|
||||
<!-- <input type="text" placeholder="请选择所在地区"> -->
|
||||
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-useaddress">
|
||||
<span>详细地址:</span>
|
||||
<input type="text" placeholder="小区、门牌号等" class="userinput">
|
||||
<input type="text" placeholder="小区、门牌号等" class="userinput" v-model="alladdress">
|
||||
<textarea rows="10" cols="30" placeholder="请输入详细地址">
|
||||
|
||||
</textarea>
|
||||
|
||||
</div>
|
||||
|
||||
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="rc-button">
|
||||
<span @click="openclose()">取消</span>
|
||||
<em @click="openclose()">确认</em>
|
||||
<em @click="register()">确认</em>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="rc-button">
|
||||
<div class="rc-footbutton" @click="onAdd()">
|
||||
<span>新增收货地址</span>
|
||||
@ -51,14 +53,19 @@
|
||||
import Myheader from '~/components/header.vue'
|
||||
import MyFooter from '~/components/rc-footer.vue'
|
||||
import addressInput from '~/components/addressInput.vue'
|
||||
import {editaddress} from "../../ajax/getData";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chosenAddressId: "1",
|
||||
usermessage:null,
|
||||
checked: true,
|
||||
tel: "",
|
||||
alladdress:'',
|
||||
userid: null,
|
||||
usermessage:null,
|
||||
dialogInfo1:false,
|
||||
userpeople:'',
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
@ -89,36 +96,58 @@ export default {
|
||||
handleClose1(){
|
||||
this.dialogInfo1 = false
|
||||
},
|
||||
onEdit(item, index) {
|
||||
// let userid = item.id;
|
||||
console.log(item);
|
||||
this.$router.push({
|
||||
path: "/useraddress/editaddress",
|
||||
query: {
|
||||
id: item,
|
||||
},
|
||||
});
|
||||
|
||||
register(){
|
||||
console.log(this.tel)
|
||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '手机号码输入有误'
|
||||
});
|
||||
return
|
||||
}else if(this.alladdress===''){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请输入详细地址'
|
||||
});
|
||||
return
|
||||
}
|
||||
else if(this.userpeople===''){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请输入姓名'
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
else{
|
||||
this.editaddress();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//添加
|
||||
async editaddress(item) {
|
||||
// this.userid
|
||||
let useradd={
|
||||
memberId:this.userid,
|
||||
detailAddress:this.alladdress,
|
||||
recipient:this.userpeople,
|
||||
recipientPhone:this.tel,
|
||||
provinceId:'',
|
||||
cityId:'',
|
||||
districtId:'',
|
||||
|
||||
}
|
||||
let data = await editaddress(useradd);
|
||||
if(data){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '地址添加成功'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
onAdd(item, index) {
|
||||
// let userid = item.id;
|
||||
// console.log(item);
|
||||
this.$router.push({
|
||||
path: "/useraddress/addaddress",
|
||||
// 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) {
|
||||
@ -134,8 +163,23 @@ export default {
|
||||
MyFooter,
|
||||
addressInput
|
||||
},
|
||||
computed:{
|
||||
usertel() {
|
||||
if (this.tel === "") {
|
||||
return "";
|
||||
} else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel)) {
|
||||
return "手机号格式错误";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||
// this.editaddress(this.usermessage);
|
||||
this.userid = this.usermessage.data.id;
|
||||
//地址的查询
|
||||
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||
// this.editaddress(this.usermessage);
|
||||
|
@ -2,23 +2,23 @@
|
||||
<div>
|
||||
<Myheader></Myheader>
|
||||
<div class="rc-top"></div>
|
||||
|
||||
<div class="rc-max-width--xl rc-main">
|
||||
<div class="usercontend">
|
||||
<div class="rc-max-width--xl">
|
||||
<div class="rc-max-width--xl rc-people">
|
||||
<span>收货人:</span>
|
||||
<input type="text" placeholder="李某某">
|
||||
<input type="text" placeholder="" v-model="recipient">
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-phone">
|
||||
<span>手机号码:</span>
|
||||
<input type="text" placeholder="15279944631">
|
||||
<input type="text" placeholder="" v-model="recipientPhone">
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-address">
|
||||
<span>所在地区:</span>
|
||||
<input type="text" placeholder="请选择所在地区">
|
||||
<addressInput @getmenu="onGetMenu" @closeDialog = "handleClose1" :dialogInfo1="dialogInfo1"></addressInput>
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-useaddress">
|
||||
<span>详细地址:</span>
|
||||
<input type="text" placeholder="天河客运站">
|
||||
<input type="text" placeholder="" v-model="detailAddress" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -27,12 +27,14 @@
|
||||
<span>新增收货地址</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="rc-button">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="rc-button">
|
||||
<span @click="openclose()">取消</span>
|
||||
<em @click="openclose()">确认</em>
|
||||
<em @click="register()">确认</em>
|
||||
</div>
|
||||
<!-- <MyFooter></MyFooter> -->
|
||||
|
||||
<MyFooter></MyFooter>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -40,13 +42,20 @@
|
||||
|
||||
import Myheader from '~/components/header.vue'
|
||||
import MyFooter from '~/components/rc-footer.vue'
|
||||
import { editupdate} from "../../ajax/getData";
|
||||
import addressInput from '~/components/addressInput.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chosenAddressId: "1",
|
||||
checked: true,
|
||||
userid: null,
|
||||
dialogInfo1:false,
|
||||
usermessage:null,
|
||||
detailAddress:'',
|
||||
recipientPhone:'',
|
||||
recipient:'',
|
||||
addressid:'',
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
@ -71,26 +80,63 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onEdit(item, index) {
|
||||
// let userid = item.id;
|
||||
console.log(item);
|
||||
this.$router.push({
|
||||
path: "/useraddress/editaddress",
|
||||
query: {
|
||||
id: item,
|
||||
},
|
||||
});
|
||||
onGetMenu(values){
|
||||
console.log(values,+'111111');
|
||||
},
|
||||
onAdd(item, index) {
|
||||
// let userid = item.id;
|
||||
// console.log(item);
|
||||
this.$router.push({
|
||||
path: "/useraddress/addaddress",
|
||||
// query: {
|
||||
// id: userid,
|
||||
// },
|
||||
});
|
||||
handleClose1(){
|
||||
this.dialogInfo1 = false
|
||||
},
|
||||
|
||||
register(){
|
||||
console.log(this.tel)
|
||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.recipientPhone) || this.recipientPhone === "") {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '手机号码输入有误'
|
||||
});
|
||||
return
|
||||
}else if(this.alladdress===''){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请输入详细地址'
|
||||
});
|
||||
return
|
||||
}
|
||||
else if(this.userpeople===''){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请输入姓名'
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
else{
|
||||
this.editaddress();
|
||||
}
|
||||
},
|
||||
|
||||
//更改
|
||||
async editaddress(item) {
|
||||
let useradd={
|
||||
memberId:this.userid,
|
||||
id:this.id,
|
||||
provinceId:'',//省份id,
|
||||
cityId:'',//城市id,
|
||||
districtId:'',//区域id,
|
||||
detailAddress:this.detailAddress, //详细地址
|
||||
recipient:this.recipient, //收件人姓名
|
||||
recipientPhone:this.recipientPhone, //收件人电话
|
||||
}
|
||||
let data = await editupdate(useradd);
|
||||
if(data){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '地址修改成功'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
@ -114,9 +160,19 @@ export default {
|
||||
components: {
|
||||
Myheader,
|
||||
MyFooter,
|
||||
addressInput
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// if(this.$route.query.id){
|
||||
this.userid = JSON.parse(localStorage.getItem("userInfo")).data.id;
|
||||
this.recipient=this.$route.query.recipient
|
||||
this.recipientPhone=this.$route.query.recipientPhone
|
||||
this.detailAddress=this.$route.query.detailAddress
|
||||
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);
|
||||
|
@ -10,15 +10,15 @@
|
||||
<div class="rc-center">
|
||||
<div class=" rc-title">
|
||||
<em>
|
||||
{{ item.name }}
|
||||
{{ item.recipient }}
|
||||
</em>
|
||||
<span>
|
||||
{{ item.tel }}
|
||||
{{ item.recipientPhone }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="rc-address">
|
||||
<span>
|
||||
{{ item.address }}
|
||||
{{item.provinceName}}{{ item.districtName }}{{item.detailAddress}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
@ -47,9 +47,10 @@
|
||||
</div>
|
||||
|
||||
<div class="usercontshow useredit">
|
||||
|
||||
<img src="../../assets/image/userselect.png" alt="">
|
||||
<div class="usercontshow alledit" @click="onAdd()">
|
||||
<img src="../../static/images/adddress.png" alt="">
|
||||
<span>添加收货地址</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-button">
|
||||
<div class="rc-footbutton" @click="onAdd()">
|
||||
@ -65,6 +66,7 @@
|
||||
<script>
|
||||
import Myheader from '~/components/header.vue'
|
||||
import MyFooter from '~/components/rc-footer.vue'
|
||||
import { selectaddress,editupdate,editdelete} from "../../ajax/getData";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -96,13 +98,30 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeadddress(item,index){
|
||||
console.log(item,index);
|
||||
console.log(item.isDefault)
|
||||
if(item.isDefault==false){
|
||||
item.isDefault=true
|
||||
}else{
|
||||
item.isDefault=false;
|
||||
}
|
||||
this.editupdate(this.userid,item.id,item.isDefault)
|
||||
this.editaddress();
|
||||
|
||||
},
|
||||
onEdit(item, index) {
|
||||
// let userid = item.id;
|
||||
console.log(item);
|
||||
// debugger
|
||||
|
||||
this.$router.push({
|
||||
path: "/useraddress/editaddress",
|
||||
query: {
|
||||
id: item,
|
||||
recipient: item.recipient,
|
||||
recipientPhone:item.recipientPhone,
|
||||
detailAddress:item.detailAddress,
|
||||
id:item.id
|
||||
},
|
||||
});
|
||||
},
|
||||
@ -117,24 +136,37 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
//更改地址
|
||||
async editupdate(userid,addressid,isDefault) {
|
||||
let useradd={
|
||||
memberId:userid,
|
||||
id:addressid,
|
||||
isDefault:isDefault,
|
||||
}
|
||||
|
||||
let data = await editupdate(useradd);
|
||||
// if(data){
|
||||
// this.editaddress();
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
//删除地址
|
||||
// async userdelete(item) {
|
||||
// console.log(item.memberId);
|
||||
// let data = await editdelete(this.userid, item.id);
|
||||
// this.editaddress(this.usermessage);
|
||||
// console.log(data);
|
||||
// },
|
||||
|
||||
async userdelete(item) {
|
||||
console.log(item.memberId);
|
||||
let data = await editdelete(this.userid, item.id);
|
||||
this.editaddress();
|
||||
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);
|
||||
// },
|
||||
async editaddress(user) {
|
||||
// user.data.id=844350;
|
||||
let data = await selectaddress(this.userid);
|
||||
console.log(data);
|
||||
// this.list=data;
|
||||
// console.log(this.list);
|
||||
console.log(data);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Myheader,
|
||||
@ -143,9 +175,11 @@ export default {
|
||||
|
||||
mounted() {
|
||||
//地址的查询
|
||||
// this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||
// this.editaddress(this.usermessage);
|
||||
// this.userid = this.usermessage.data.id;
|
||||
this.usermessage = JSON.parse(localStorage.getItem("userInfo"));
|
||||
this.userid = this.usermessage.data.id;
|
||||
console.log(this.userid);
|
||||
this.editaddress(this.userid);
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
BIN
rc-busness/static/images/adddress.png
Normal file
BIN
rc-busness/static/images/adddress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Loading…
Reference in New Issue
Block a user