add_address.html
7.96 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="tpshop" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>添加地址-{$tpshop_config['shop_info_store_title']}</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" href="__STATIC__/css/public.css">
<link rel="stylesheet" href="__STATIC__/css/user.css">
<script src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/mobile_common.js"></script>
<style type="text/css">
.dotm_btn1{
float: none;
margin: auto;
background: #e30000;
width: 30%;
height: 35px;
line-height: 35px;
border-radius: 35px;
}
/* 开关*/
#toggle-button{ display: none; }
.button-label{
position: relative;
display: inline-block;
width: 50px;
height: 20px;
background-color: #ccc;
border-radius: 30px;
overflow: hidden;
}
.circle{
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #fff;
}
.button-label .text {
line-height: 30px;
font-size: 18px;
text-shadow: 0 0 2px #ddd;
}
.on { color: #fff; display: none; text-indent: 10px;}
.off { color: #fff; display: inline-block; text-indent: 34px;}
.button-label .circle{
left: 0;
transition: all 0.3s;
}
#toggle-button:checked + label.button-label .on{ display: inline-block; }
#toggle-button:checked + label.button-label .off{ display: none; }
.cta{
background-color:#e30000;
}
.cts{
left: 30px !important;
}
.wenben{
width: 70%;
height: 90px;
border: none;
padding: 14px;
}
.operation{
width: 100%;
height: 50px;
line-height: 50px;
margin: 0px 0px;
}
.addressmone ul{
width: 100%;
}
.addressmone ul li{
width: 100%;
padding-left: 15px;
margin: auto;
border-bottom: 1px solid #ccc!important;
}
</style>
</head>
<body>
<!--<header>
<div class="tab_nav">
<div class="header">
<div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回"></a></div>
<div class="h-mid">地址管理</div>
<div class="h-right">
<aside class="top_bar">
<div onClick="show_menu();$('#close_btn').addClass('hid');" id="show_more"><a href="javascript:;"></a> </div>
</aside>
</div>
</div>
</div>
</header>-->
<include file="public/menu" />
<include file="public/navBall" />
<div id="tbh5v0">
<div class="addressmone">
<form action="{:U('Mobile/User/add_address',array('stoid'=>$Think.request.stoid))}" method="post" onSubmit="return checkForm()">
<input name="store_id" value="{$pstore_id}" type="hidden">
<ul>
<li>
<span>收货人</span>
<input name="consignee" id="consignee" type="text" value="{$address.consignee}" maxlength="12" placeholder="请填写收货人姓名" />
</li>
<li>
<span>手机号码</span>
<input type="tel" name="mobile" value="{$address.mobile}" onpaste="this.value=this.value.replace(/[^\d-]/g,'')" onKeyUp="this.value=this.value.replace(/[^\d-]/g,'')" maxlength="15" placeholder="请填写收货人手机号" />
</li>
<li class="rel"onclick="show_addsele()">
<span>所在地区</span>
<input type="text" value="" id="showaddrQ" readonly
placeholder="省市区县,乡镇等"/>
<input name='country' value='1' type="hidden">
<input id='inp_province' name='province' value='' type="hidden">
<input id='inp_city' name='city' value='' type="hidden">
<input id='inp_district' name='district' value='' type="hidden">
<input id='inp_twon' name='twon' value='' type="hidden">
<input id='more_address' name='more_address' value="" type="hidden">
<img class="calendar abs" src="__STATIC__/images/category/leftTip.png" style="width: 8px;height: 16px;top:14px" />
</li>
<!--<li>
<span>邮政编码</span>
<input type="tel" name="zipcode" value="{$address.zipcode}" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" maxlength="10" placeholder="邮政编码" />
</li>-->
<li>
<span>详细地址</span>
<textarea class="wenben" type="text" name="address" id="address" placeholder="街道 楼牌号等">{$address.address}</textarea>
</li>
<li>
<div class="operation flex ai_center jc_sb" data-gg="0" onclick="changeIsdefault()" >
<i class="fc3">设为默认地址</i>
<input type="hidden" id="default" name="is_default" />
<div class="toggle-button-wrapper"style="margin-right: 23px;margin-top: 10px;">
<!-- <input type="checkbox" id="toggle-button" name="switch">-->
<div class="button-label">
<div class="circle"></div>
</div>
</div>
</div>
</li>
</ul>
<div style=" height:20px"></div>
<div class="dotm_btn">
<if condition="$Request.param.source eq 'cart2'">
<!--如果是下订单时提交过了的页面-->
<input type="submit" value="保存并使用该地址" class="dotm_btn1 beett" />
<input type="hidden" name="source" value="{$Request.param.source}" />
<else/>
<input type="submit" value="提交地址" class="dotm_btn1" />
</if>
</div>
</form>
</div>
</div>
<script>
function checkForm() {
layer.open({content:'加载中',time:2,type:2});
var consignee = $('input[name="consignee"]').val();
var province = $('#inp_province').val();
var city = $('#inp_city').val();
var district = $('#inp_district').val();
var address = $('#address').val();
var mobile = $('input[name="mobile"]').val();
var error = '';
if (consignee == '') {
error += '收货人不能为空 <br/>';
layer.open({ content: error, time: 2 });
return false;
}
if(mobile==""){
error += '手机号码不能为空<br/>';
layer.open({ content: error, time: 2 });
return false;
}
if (!checkMobile(mobile)) {
error += '手机号码格式有误 <br/>';
layer.open({ content: error, time: 2 });
return false;
}
if ( province=="" || province == 0) {
error += '请选择省份 <br/>';
layer.open({ content: error, time: 2 });
return false;
}
if ( city=="" || city == 0) {
error += '请选择城市 <br/>';
layer.open({ content: error, time: 2 });
return false;
}
if (district=="" || district == 0) {
error += '请选择区域 <br/>';
layer.open({ content: error, time: 2 });
return false;
}
if (address == '') {
error += '请填写地址 <br/>';
layer.open({ content: error, time: 2 });
return false;
}
return true;
}
function changeIsdefault() {
var kz=$(".button-label").hasClass("cta")
if(kz){
var aa=$(".button-label").removeClass("cta");
$(".button-label .circle").removeClass("cts")
$("#default").val("0");
}else{
$(".button-label").addClass("cta")
$(".button-label .circle").addClass("cts")
$("#default").val("1");
}
}
</script>
<!--地址选择控件-->
<include file="public/addrsele"/>
</body>
</html>