edit_address.html
6.25 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<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']}" />
<link rel="stylesheet" href="__STATIC__/css/index.css" type="text/css">
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/slider.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->
</head>
<style type="text/css">
.wi80-BFB{width:80%}
.wi40-BFB{width:40%}
.seauii{ padding:7px 10px; margin-right:10px}
.he110{ height:110px}
.di-bl{ display:inherit}
</style>
<body>
<div class="adderss-add">
<div class="ner-reac ol_box_4" style="visibility: visible; position: fixed; z-index: 500; width: 100%; height:100%">
<div class="box-ct">
<div class="box-header">
<!-- <a href="" class="box-close"></a> -->
<span class="box-title">添加地址</span>
</div>
<form action="" method="post" onSubmit="return checkForm()">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right"><span class="xh">*</span>收货人: </td>
<td><input class="wi80-BFB" name="consignee" type="text" value="{$address.consignee}" maxlength="12" /></td>
</tr>
<tr>
<td align="right"><span class="xh">*</span>收货地址: </td>
<td>
<select class="di-bl fl seauii" name="province" id="province" onChange="get_city(this)">
<option value="0">请选择</option>
<volist name="province" id="p">
<option <if condition="$address['province'] eq $p['id']">selected</if> value="{$p.id}">{$p.name}</option>
</volist>
</select>
<select class="di-bl fl seauii" name="city" id="city" onChange="get_area(this)">
<option value="0">请选择</option>
<volist name="city" id="p">
<option <if condition="$address['city'] eq $p['id']">selected</if> value="{$p.id}">{$p.name}</option>
</volist>
</select>
<select class="di-bl fl seauii" name="district" id="district" onChange="get_twon(this)">
<option value="0">请选择</option>
<volist name="district" id="p">
<option <if condition="$address['district'] eq $p['id']">selected</if> value="{$p.id}">{$p.name}</option>
</volist>
</select>
<select class="di-bl fl seauii" name="twon" id="twon" <if condition="$address['twon'] gt 0 ">style="display:block;"<else/>style="display:none;"</if>>
<volist name="twon" id="p">
<option <if condition="$address['twon'] eq $p['id']">selected</if> value="{$p.id}">{$p.name}</option>
</volist>
</select>
<br>
</td>
</tr>
<tr>
<td align="right" valign="top"><span class="xh">*</span>详细地址: </td>
<td><textarea class="he110 wi80-BFB re-no" name="address" id="address" placeholder="详细地址" maxlength="100">{$address.address}</textarea></td>
</tr>
<tr>
<td align="right">邮编: </td>
<td><input class="wi80-BFB" type="text" name="zipcode" value="{$address.zipcode}" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" maxlength="10"/></td>
</tr>
<tr>
<td align="right"><span class="xh">*</span>手机: </td>
<td><input class="wi40-BFB" type="text" name="mobile" value="{$address.mobile}" onpaste="this.value=this.value.replace(/[^\d-]/g,'')" onKeyUp="this.value=this.value.replace(/[^\d-]/g,'')" maxlength="15"/></td>
</tr>
<tr>
<td class="pa-50-0"> </td>
<td align="right">
<button type="submit" class="box-ok ma-le--70"><span>保存收货地址</span></button>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/pc_common.js"></script>
<script>
function checkForm(){
var consignee = $('input[name="consignee"]').val();
var province = $('select[name="province"]').find('option:selected').val();
var city = $('select[name="city"]').find('option:selected').val();
var district = $('select[name="district"]').find('option:selected').val();
var address = $('textarea[name="address"]').val();
var mobile = $('input[name="mobile"]').val();
var error = '';
if(consignee == ''){
error += '收货人不能为空 <br/>';
}
if(province==0){
error += '请选择省份 <br/>';
}
if(city==0){
error += '请选择城市 <br/>';
}
if(district==0){
error += '请选择区域 <br/>';
}
if(address == ''){
error += '请填写地址 <br/>';
}
if(!checkMobile(mobile))
error += '手机号码格式有误 <br/>';
if(error){
//alert(error);
layer.alert(error, {icon: 2});
// layer.msg('只想弱弱提示');
return false;
}
return true;
}
</script>
</body>
</html>