-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathindex.html
43 lines (40 loc) · 1.32 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能识别收货地址</title>
</head>
<body>
<h2>支持以下数据格式(打印结果请在控制台查看)</h2>
<h3>最新支持数据格式:<br>北京市朝阳区富康路姚家园3楼马云150-0000-0000<br>
北京市朝阳区富康路姚家园3号楼5单元3305马云15000000000<br>
北京市朝阳区富康路姚家园3号楼5单元3305马云15000000000邮编038300
</h3>
<p>马云,1351111111,北京市朝阳区富康路姚家园3楼邮编038300</p>
<p>马云1351111111北京市朝阳区富康路姚家园3楼0</p>
<p>北京市朝阳区富康路姚家园3楼1351111111马云</p>
<p>北京市朝阳区富康路姚家园3楼150-0000-0000马云</p>
<textarea onchange="smart()" cols="50" rows="10" id='textarea' placeholder="请粘贴你的地址"></textarea>
<div id="value"></div>
</body>
</html>
<script src="area-list.js"></script>
<script src="address-parse.js"></script>
<script>
parseArea(areaList)
function $(id) {
return document.getElementById(id)
}
function smart(){
let value = $('textarea').value;
let parse_list = parse(value);
console.log(parse(value));
let html= '';
for(let key in parse_list){
if(parse_list[key]){
html+=`<p>`+key+`:`+parse_list[key]+`</p>`
}
}
$('value').innerHTML = html
}
</script>