格式化代码
This commit is contained in:
96
index.html
96
index.html
@@ -12,10 +12,8 @@
|
||||
<script src="js/zipCode.js"></script>
|
||||
<script src="js/address_parse.js"></script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
<!-- Place this tag in your head or just before your close body tag. -->
|
||||
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
||||
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
||||
<style>
|
||||
|
||||
#value .key {
|
||||
color: #ff5722;
|
||||
display: inline-block;
|
||||
@@ -32,16 +30,16 @@
|
||||
|
||||
<body>
|
||||
<div class="page-header">
|
||||
<h1>地址智能识别 <small>支持省市区街道/姓名/电话/邮编/身份证号码(字母大写)</small>
|
||||
<a class="github-button" href="https://github.com/wzc570738205/smartParsePro" data-size="large" data-show-count="true" aria-label="Star wzc570738205/smartParsePro on GitHub">Star</a></h1>
|
||||
<!-- Place this tag where you want the button to render. -->
|
||||
<h1>地址智能识别 <small>支持省市区街道/姓名/电话/邮编/身份证号码(字母大写)</small>
|
||||
<a class="github-button" href="https://github.com/wzc570738205/smartParsePro" data-size="large"
|
||||
data-show-count="true" aria-label="Star wzc570738205/smartParsePro on GitHub">Star</a></h1>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" role="alert">地址、姓名、电话、邮编、身份证号码(字母大写)用空格分开!!(支持以下数据格式)</div>
|
||||
<ol>
|
||||
<li>广东省珠海市香洲区盘山路28号幸福茶庄 陈景勇 13593464918</li>
|
||||
<li>陕西省西安市雁塔区丈八沟街道高新四路高新大都荟 马云 13593464918</li>
|
||||
<li>陕西省西安市雁塔区丈八沟街道高新四路高新大都荟710061 刘国良 13593464918 211381198512096810</li>
|
||||
<li>陕西省西安市雁塔区丈八沟街道高新四路高新大都荟710061 刘国良 13593464918 211381198512096810</li>
|
||||
<li>北京市朝阳区姚家园3楼 13593464918 马云</li>
|
||||
<li>北京市朝阳区姚家园3楼 150-3569-6956 马云</li>
|
||||
<li>河北省石家庄市新华区中华北大街68号鹿城商务中心6号楼1413室 150-3569-6956 马云</li>
|
||||
@@ -49,36 +47,36 @@
|
||||
|
||||
<textarea class="form-control" onchange="getAddress()" cols="50" rows="7" id='textarea'
|
||||
placeholder="请粘贴你的地址"></textarea>
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputName2">省/直辖市</label>
|
||||
<select class="form-control" id="province">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">市</label>
|
||||
<select class="form-control" id="city">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">区/县</label>
|
||||
<select class="form-control" id="county">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">街道</label>
|
||||
<select class="form-control" id="street">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputName2">省/直辖市</label>
|
||||
<select class="form-control" id="province">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">市</label>
|
||||
<select class="form-control" id="city">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">区/县</label>
|
||||
<select class="form-control" id="county">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">街道</label>
|
||||
<select class="form-control" id="street">
|
||||
<option>请选择</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<div id="value"></div>
|
||||
</body>
|
||||
|
||||
@@ -104,18 +102,18 @@
|
||||
getStreet($("#county").val(), parse_list)
|
||||
|
||||
}
|
||||
addressList = pcassCode;
|
||||
addressList.forEach(item => {
|
||||
formatAddresList(item, 1, '')
|
||||
})
|
||||
let province = '';
|
||||
addressList.forEach(res => {
|
||||
province += ` <option value='` + res.code + `'>` + res.name + `</option>`;
|
||||
})
|
||||
$("#province").html(province)
|
||||
getCity($("#province").val())
|
||||
getCounty($("#city").val())
|
||||
getStreet($("#county").val())
|
||||
addressList = pcassCode;
|
||||
addressList.forEach(item => {
|
||||
formatAddresList(item, 1, '')
|
||||
})
|
||||
let province = '';
|
||||
addressList.forEach(res => {
|
||||
province += ` <option value='` + res.code + `'>` + res.name + `</option>`;
|
||||
})
|
||||
$("#province").html(province)
|
||||
getCity($("#province").val())
|
||||
getCounty($("#city").val())
|
||||
getStreet($("#county").val())
|
||||
|
||||
$("#province").change(res => {
|
||||
let provinceCode = $("#province").val();
|
||||
|
||||
@@ -116,7 +116,7 @@ function smatrAddress(event) {
|
||||
//address= event.replace(/\s/g, ''); //去除空格
|
||||
address = stripscript(address); //过滤特殊字符
|
||||
console.log(address);
|
||||
|
||||
|
||||
//身份证号匹配
|
||||
if (IdentityCodeValid(address)) {
|
||||
smartObj.idCard = address;
|
||||
|
||||
Reference in New Issue
Block a user