mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-16 15:43:49 +08:00
@@ -1,61 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="usercontend">
|
||||
<div class="rc-max-width--xl">
|
||||
<h2>{{ title }}</h2>
|
||||
<div class="rc-max-width--xl rc-people">
|
||||
<span>收货人:</span>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入收货人姓名"
|
||||
v-model="userpeople"
|
||||
/>
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-phone">
|
||||
<span>手机号码:</span>
|
||||
<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="请选择所在地区"> -->
|
||||
<addressInput
|
||||
@getmenu="onGetMenu"
|
||||
@closeDialog="handleClose1"
|
||||
:dialogInfo1="dialogInfo1"
|
||||
:defaultValues="defaultValues"
|
||||
></addressInput>
|
||||
</div>
|
||||
<div class="rc-max-width--xl rc-useaddress">
|
||||
<span>详细地址:</span>
|
||||
<!-- <input
|
||||
type="text"
|
||||
placeholder="小区、门牌号等"
|
||||
class="userinput"
|
||||
|
||||
/> -->
|
||||
<textarea
|
||||
rows="10"
|
||||
v-model="alladdress"
|
||||
cols="30"
|
||||
placeholder="请输入详细地址"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="address">
|
||||
<li>
|
||||
<span>收货人:</span>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入收货人姓名"
|
||||
v-model="userpeople"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span>手机号码:</span>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入11位手机号码"
|
||||
v-model="tel"
|
||||
:error-message="usertel"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span>所在地区:</span>
|
||||
<addressInput
|
||||
@getmenu="onGetMenu"
|
||||
@closeDialog="handleClose1"
|
||||
:dialogInfo1="dialogInfo1"
|
||||
:defaultValues="defaultValues"
|
||||
></addressInput>
|
||||
</li>
|
||||
<li>
|
||||
<span>详细地址:</span>
|
||||
<textarea v-model="alladdress" placeholder="请输入详细地址"></textarea>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn_cont">
|
||||
<span class="btn1" @click="openclose()">取消</span>
|
||||
<span class="btn2" @click="register()">确认</span>
|
||||
</div>
|
||||
<div class="rc-button">
|
||||
<span @click="openclose()">取消</span>
|
||||
<em @click="register()">确认</em>
|
||||
</div>
|
||||
<!-- <div class="rc-button">
|
||||
<div class="rc-footbutton" @click="onAdd()">
|
||||
<span>新增收货地址</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -80,36 +60,11 @@ export default {
|
||||
provinceId: "",
|
||||
cityId: "",
|
||||
districtId: "",
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
name: "张三",
|
||||
tel: "13000000000",
|
||||
address: "浙江省杭州市西湖区文三路 138 号",
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "李四",
|
||||
tel: "1310000000",
|
||||
address: "浙江省杭州市拱墅区莫干山路 50 号",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "李四",
|
||||
tel: "1310000000",
|
||||
address: "浙江省杭州市拱墅区莫干山路 50 号",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
props: ["editAddressData"],
|
||||
methods: {
|
||||
onGetMenu(values) {
|
||||
// console.log(values, +"111111");
|
||||
// let user = values[2].id;
|
||||
// user = user.split("-");
|
||||
|
||||
if (this.id == "") {
|
||||
this.provinceId = values[0].id;
|
||||
this.cityId = values[1].id;
|
||||
@@ -127,7 +82,6 @@ export default {
|
||||
},
|
||||
|
||||
register() {
|
||||
console.log(this.tel);
|
||||
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
@@ -200,33 +154,6 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
editInfo() {
|
||||
if (this.editAddressData.saveType == "edit") {
|
||||
this.title = "修改收货地址";
|
||||
this.tel = this.editAddressData.tel;
|
||||
this.alladdress = this.editAddressData.detailAddress;
|
||||
this.userid = this.editAddressData.memberId;
|
||||
this.userpeople = this.editAddressData.name;
|
||||
this.provinceId = this.editAddressData.provinceId;
|
||||
this.cityId = this.editAddressData.cityId;
|
||||
this.districtId = this.editAddressData.districtId;
|
||||
this.defaultValues = [
|
||||
{
|
||||
id: this.provinceId,
|
||||
name: this.editAddressData.provinceName,
|
||||
},
|
||||
{
|
||||
id: this.cityId,
|
||||
name: this.editAddressData.cityName,
|
||||
},
|
||||
{
|
||||
id: this.districtId,
|
||||
name: this.editAddressData.districtName,
|
||||
},
|
||||
];
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
addressInput,
|
||||
@@ -276,6 +203,81 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped >
|
||||
@import url("../assets/css/global.less");
|
||||
@import url("../assets/css/addaddress.less");
|
||||
.address {
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
color: 333333;
|
||||
li {
|
||||
display: flex;
|
||||
padding: 8px;
|
||||
span {
|
||||
display: block;
|
||||
width: 110px;
|
||||
font-weight: bold;
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
border: 1px solid #808285;
|
||||
color: #999999;
|
||||
font-size: 16px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
border: 1px solid #808285;
|
||||
color: #999999;
|
||||
font-size: 16px;
|
||||
padding: 8px 0 0 16px;
|
||||
height: 118px;
|
||||
}
|
||||
.ts-area-picker-containe {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.btn_cont {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
.btn1,
|
||||
.btn2 {
|
||||
padding: 10px 62px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
border-radius: 30px;
|
||||
margin: 0 20px;
|
||||
}
|
||||
.btn1 {
|
||||
border: 2px solid #e2001a;
|
||||
color: #e2001a;
|
||||
}
|
||||
.btn2 {
|
||||
background: #e2001a;
|
||||
color: #ffffff;
|
||||
}
|
||||
//手机端
|
||||
@media screen and (max-width: 768px) {
|
||||
.btn1,
|
||||
.btn2 {
|
||||
padding: 10px 32px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.address {
|
||||
input {
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
textarea {
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
height: 38px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user