add_address.html
5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="__INDEX__/css/weui.css">
<link rel="stylesheet" href="__INDEX__/css/jquery-weui.css">
<link rel="stylesheet" href="__INDEX__/css/demos.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_9njxvxqweig.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<title>添加地址</title>
<style>
body,html{
width:100%;
height:100%;
background: #F5F6FA;
}
.select_address{
width:6.86rem;
margin: 0 auto;
height:1.01rem;
border-bottom: 1px solid #f5f5f5;
display:flex;
/*justify-content: space-between;*/
align-items: center;
position: relative;
padding: 0 0.33rem;
}
.weui-cell{
/*display:flex;*/
/*justify-content: space-between;*/
/*align-items: center;*/
}
.detail_address{
width:6.86rem;
margin: 0 auto;
height:1.01rem;
border-bottom: 1px solid #f5f5f5;
display:flex;
/*justify-content: space-between;*/
align-items: center;
padding: 0 0.33rem;
}
.place{
width:1.5rem;
color:#1A1A1A;
font-size: 0.3rem;
}
.detailplace{
color:#999999;
font-size: 0.3rem;
}
.province{
color:#999999;
font-size: 0.3rem;
}
.weui-label {
width:1.3rem;
}
.detailplace{
border:none;
outline: none;
/*margin-right:0.6rem;*/
}
.select{
background: #fff;
}
.save{
width:6.86rem;
height:0.88rem;
background:#FE0A01;
color:#fff;
font-size:0.32rem ;
text-align: center;
line-height: 0.88rem;
border-radius: 0.44rem;
position:fixed;
bottom:0.55rem;
left:0;
right:0;
margin: 0 auto;
box-shadow:0px 15px 30px 0px rgba(254,10,1,0.24);
}
.icon-xiaotuziCduan_{
color:#999999;
font-size: 0.5rem;
position:absolute;
right:0.3rem;
z-index: 5;
}
.selectadd{
width:4.6rem;
position:relative;
border:none;
outline:none;
z-index: 8;
/*margin-left: 0.5rem;*/
}
</style>
</head>
<body>
<div class="container">
<div class="select">
<div class="select_address">
<p class="place">选择地区</p>
<div class="weui-cell" style="padding: 0">
<!--<div class="weui-cell__hd"><label for="date" class="weui-label place">选择地区</label></div>-->
<div class="weui-cell__bd">
<input class="weui-input selectadd" id="end" type="text" placeholder="请选择省市区" >
</div>
</div>
<p class="iconfont icon-xiaotuziCduan_"></p>
</div>
<div class="detail_address">
<p class="place">详细地址</p>
<input id="P" type="text" placeholder="请填写详细地址" class="detailplace">
</div>
<div class="detail_address">
<p class="place">收货人</p>
<input id="N" type="text" placeholder="请填写收货人" class="detailplace">
</div>
<div class="detail_address">
<p class="place">联系电话</p>
<input id="M" type="text" placeholder="请填写联系电话" class="detailplace">
</div>
</div>
<div class="save">保存</div>
</div>
</body>
<script type="text/javascript" src="__INDEX__/js/jquery-2.1.4.js"></script>
<script type="text/javascript" src="__INDEX__/js/fastclick.js"></script>
<script>
$(function() {
FastClick.attach(document.body);
});
</script>
<script type="text/javascript" src="__INDEX__/js/jquery-weui.js"></script>
<script type="text/javascript" src="__INDEX__/js/city-picker.js"></script>
<script>
$("#end,.icon-xiaotuziCduan").cityPicker({
title: "请选择地区"
});
</script>
<script>
$(".save").click(function () {
var code = $("#end").attr('data-codes');
var label = $("#end").val();
if(code == null || label == null || $("#P").val() == '' || $("#N").val() == '' || $("#M").val() == '') {
alert('请完善地址信息');
}else {
var pattern = /^1[34578]\d{9}$/;
if(!pattern.test($("#M").val())) {
alert('请输入正确的联系方式');
}else {
$.ajax({
url: "{:url('user/Center/addAddress')}",
data: {
code: code,
label: label,
place: $("#P").val(),
name: $("#N").val(),
mobile: $("#M").val()
},
type: "POST",
dataType: "JSON",
success: function (data) {
window.location.href = data.url;
}
})
}
}
})
</script>
</html>