updated 样式调整

This commit is contained in:
mumuy 2025-07-25 16:31:54 +08:00
parent 7f61f17bb8
commit 0c6bec496f
3 changed files with 372 additions and 306 deletions

View File

@ -1,52 +1,52 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
<meta name="robots" content="all"> <meta name="robots" content="all">
<meta name="referrer" content="always"> <meta name="referrer" content="always">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-transform" />
<meta name="format-detection" content="telephone=no"/> <meta name="format-detection" content="telephone=no"/>
<title>中国行政区划 行政区划代码 省市区三级数据 身份证号码查询</title> <title>中国行政区划 行政区划代码 省市区三级数据 身份证号码查询</title>
<meta name="keywords" content="中国行政区划,行政区划代码,省市区三级联动,身份证号码查询,身份证解析,中华人民共和国行政区划"/> <meta name="keywords" content="中国行政区划,行政区划代码,省市区三级联动,身份证号码查询,身份证解析,中华人民共和国行政区划"/>
<meta name="description" content="收录了从1980年至今40多年来的中国行政区划数据用于地名的选择和身份证号码解析等"/> <meta name="description" content="收录了从1980年至今40多年来的中国行政区划数据用于地名的选择和身份证号码解析等"/>
<link rel="stylesheet" href="static/style/index.css"> <link rel="stylesheet" href="static/style/index.css">
<script type="text/javascript"> <script type="text/javascript">
setTimeout(function(){ setTimeout(function(){
if(location.protocol.indexOf('http')>-1&&location.hostname.indexOf('passer-by.com')==-1){ if(location.protocol.indexOf('http')>-1&&location.hostname.indexOf('passer-by.com')==-1){
location.href = 'http://passer-by.com/'; location.href = 'http://passer-by.com/';
}else if( window.top != window.self ) { }else if( window.top != window.self ) {
window.top.location = self.location.href; window.top.location = self.location.href;
} }
},parseInt(3000+15000*Math.random())); },parseInt(3000+15000*Math.random()));
</script> </script>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<div class="header"> <div class="header">
<div class="inner"> <div class="inner">
<div class="mod-head"> <div class="mod-head">
<div class="bd"> <div class="bd">
<a class="btn" href="https://github.com/mumuy/data_location/" rel="nofollow" target="_blank" title="Github"> <a class="btn" href="https://github.com/mumuy/data_location/" rel="nofollow" target="_blank" title="Github">
<svg aria-hidden="true" class="octicon" height="20" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg> <svg aria-hidden="true" class="octicon" height="20" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
<span>Github</span> <span>Github</span>
</a> </a>
<a class="btn" href="/">个人网站</a> <a class="btn" href="/">个人网站</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="container"> <div class="container">
<div class="mod-panel"> <div class="mod-panel">
<div class="inner"> <div class="inner">
<div class="hd"> <div class="hd">
<h1>中国行政区划数据<span class="tag">数据开源</span></h1> <h1>中国行政区划数据<span class="tag">数据开源</span></h1>
<p>行政区划共有<b>34</b>个省级行政区,包含<b>23</b>个省、<b>5</b>个自治区、<b>4</b>个直辖市、<b>2</b>个特别行政区<p> <p>行政区划共有<b>34</b>个省级行政区,包含<b>23</b>个省、<b>5</b>个自治区、<b>4</b>个直辖市、<b>2</b>个特别行政区<p>
<p>其中大陆地区地级行政区有<b class="city1">-</b>个地级市、<b class="city2">-</b>个地区、<b class="city3">-</b>个自治州、<b class="city4">-</b>个盟</p> <p>其中大陆地区地级行政区有<b class="city1">-</b>个地级市、<b class="city2">-</b>个地区、<b class="city3">-</b>个自治州、<b class="city4">-</b>个盟</p>
<p>县级行政区有<b class="county1">-</b>个市辖区、<b class="county2">-</b>个县级市、<b class="county3">-</b>个县、<b class="county4">-</b>个自治县、<b class="county5">-</b>个旗、<b class="county6">-</b>个自治旗、<b class="county7">-</b>个特区、<b class="county8">-</b>个林区</p> <p>县级行政区有<b class="county1">-</b>个市辖区、<b class="county2">-</b>个县级市、<b class="county3">-</b>个县、<b class="county4">-</b>个自治县、<b class="county5">-</b>个旗、<b class="county6">-</b>个自治旗、<b class="county7">-</b>个特区、<b class="county8">-</b>个林区</p>
<div class="buttons"> <div class="buttons">
<a class="btn btn-blue" href="https://passer-by.com/widget-region/" target="_blank"> <a class="btn btn-blue" href="https://passer-by.com/widget-region/" target="_blank">
<img src="./static/image/icon-selector.png" width="24" height="24"> <img src="./static/image/icon-selector.png" width="24" height="24">
<span>行政区划选择器</span> <span>行政区划选择器</span>
@ -56,270 +56,292 @@
<span>身份证号码解析</span> <span>身份证号码解析</span>
</a> </a>
</div> </div>
</div> </div>
<div class="bd"> <div class="bd">
<div id="location" class="box"> <div id="location" class="box">
<div class="c-hd"> <div class="c-hd">
<span class="title">行政区划历史查询</span> <span class="title">行政区划历史查询</span>
<a class="more" href="https://jquerywidget.com/jquery-citys/" target="_blank">三级联动插件 &gt;</a> <a class="more" href="https://jquerywidget.com/jquery-citys/" target="_blank">三级联动插件 &gt;</a>
</div> </div>
<div class="c-bd"> <div class="c-bd">
<p> <p>
<select name="province"></select> <select name="province"></select>
<select name="city"></select> <select name="city"></select>
<select name="district"></select> <select name="district"></select>
</p> </p>
<div class="table-inner"></div> <div class="table-inner"></div>
</div> </div>
</div> </div>
<div id="search" class="box"> <div id="search" class="box">
<div class="c-hd"> <div class="c-hd">
<span class="title">行政区划模糊搜索</span> <span class="title">行政区划模糊搜索</span>
<a class="more" href="https://jquerywidget.com/jquery-suggestion/" target="_blank">搜索建议插件 &gt;</a> <a class="more" href="https://jquerywidget.com/jquery-suggestion/" target="_blank">搜索建议插件 &gt;</a>
</div> </div>
<div class="c-bd"> <div class="c-bd">
<form action="" method="post"> <form action="" method="post">
<p> <p>
<input type="text" name="location" value="" maxlength="18" placeholder="请输入想要找的地名"/> <input type="text" name="location" value="" maxlength="18" placeholder="请输入想要找的地名"/>
</p> </p>
</form> </form>
</div> </div>
</div> </div>
<div id="idcard" class="box"> <div id="idcard" class="box">
<div class="c-hd"> <div class="c-hd">
<span class="title">身份证号码查询</span> <span class="title">身份证号码查询</span>
<a class="more" href="https://passer-by.com/idcard/" target="_blank">中国身份证号码解析 &gt;</a> <a class="more" href="https://passer-by.com/idcard/" target="_blank">中国身份证号码解析 &gt;</a>
</div> </div>
<div class="c-bd"> <div class="c-bd">
<form action="" method="post"> <form action="" method="post">
<p> <p>
<input type="search" name="id" value="" maxlength="18" placeholder="请输入身份证号码" autocomplete="off"/> <input type="search" name="id" value="" maxlength="18" placeholder="请输入身份证号码" autocomplete="off"/>
<button class="btn">查询</button> <button class="btn">查询</button>
</p> </p>
</form> </form>
<div class="table-inner"></div> <div class="table-inner"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="mod-article"> <div class="mod-article">
<div class="inner"> <div class="inner">
<div class="bd"> <div class="bd">
<p>行政区划就是国家为了进行分级管理而实行的国土和政治、行政权力的划分。一般说来,行政区划是以在不同区域内,为全面实现地方国家机构能顺利实现各种职能而建立的不同级别政权机构作为标志。行政区划的层级与一个国家的中央地方关系模式、国土面积的大小、政府与公众的关系状况等因素有关。</p> <p>行政区划就是国家为了进行分级管理而实行的国土和政治、行政权力的划分。一般说来,行政区划是以在不同区域内,为全面实现地方国家机构能顺利实现各种职能而建立的不同级别政权机构作为标志。行政区划的层级与一个国家的中央地方关系模式、国土面积的大小、政府与公众的关系状况等因素有关。</p>
<p>行政区划代码也称行政代码它是国家行政机关的识别符号一般执行两项国家标准《中华人民共和国行政区划代码》GB/T2260-2007)和《县以下行政区划代码编制规则》GB/T10114-2003)。由9位阿拉伯数字组成相当于机关单位的身份号码。按照国务院《行政区划管理条例》规定行政区划代码由民政部门确定、发布。该标准对我国县以上行政区划的代码做了规定用六位阿拉伯数字分层次代表我国的省自治区、直辖市、地区市、州、盟、县区、市、旗的名称。代码从左至右的含义是</p> <p>行政区划代码也称行政代码它是国家行政机关的识别符号一般执行两项国家标准《中华人民共和国行政区划代码》GB/T2260-2007)和《县以下行政区划代码编制规则》GB/T10114-2003)。由9位阿拉伯数字组成相当于机关单位的身份号码。按照国务院《行政区划管理条例》规定行政区划代码由民政部门确定、发布。该标准对我国县以上行政区划的代码做了规定用六位阿拉伯数字分层次代表我国的省自治区、直辖市、地区市、州、盟、县区、市、旗的名称。代码从左至右的含义是</p>
<p>第一、二位表示省(自治区、直辖市、特别行政区)。</p> <p>第一、二位表示省(自治区、直辖市、特别行政区)。</p>
<p>第三、四位表示市地区、自治州、盟及国家直辖市所属市辖区和县的汇总码。其中01-2051-70表示省直辖市21-50表示地区自治州、盟</p> <p>第三、四位表示市地区、自治州、盟及国家直辖市所属市辖区和县的汇总码。其中01-2051-70表示省直辖市21-50表示地区自治州、盟</p>
<p>第五、六位表示县市辖区、县级市、旗。01-20表示市辖区或地区自治州、盟辖县级市21-70表示县81-99表示省直辖县级市71-80表示工业园区或者经济开发区。</p> <p>第五、六位表示县市辖区、县级市、旗。01-20表示市辖区或地区自治州、盟辖县级市21-70表示县81-99表示省直辖县级市71-80表示工业园区或者经济开发区。</p>
</div> </div>
</div> </div>
</div> </div>
<div class="mod-copy"> <div class="mod-copy">
<div class="inner"> <div class="inner">
<div class="hd"><span>数据开源</span></div> <div class="hd"><span>数据开源</span></div>
<div class="bd"> <div class="bd">
<p><span>数据基于「<a href="https://github.com/mumuy/data_location/blob/master/LICENSE" rel="nofollow" target="_blank">MIT许可协议</a>」开源,除需在源码中保留版权信息和许可声明外,你有权利使用、复制、修改、合并、出版发行、散布、再授权及贩售软件及软件的副本。</span>数据持续更新中,如发现错漏或有想法建议可在此</span> <a class="text-red" href="https://github.com/mumuy/data_location/issues" rel="nofollow" target="_blank">反馈问题</a></p> <p><span>数据基于「<a href="https://github.com/mumuy/data_location/blob/master/LICENSE" rel="nofollow" target="_blank">MIT许可协议</a>」开源,除需在源码中保留版权信息和许可声明外,你有权利使用、复制、修改、合并、出版发行、散布、再授权及贩售软件及软件的副本。</span>数据持续更新中,如发现错漏或有想法建议可在此</span> <a class="text-red" href="https://github.com/mumuy/data_location/issues" rel="nofollow" target="_blank">反馈问题</a></p>
<div class="buttons"> <div class="buttons">
<a class="github-button" href="https://github.com/mumuy" data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="large" aria-label="Follow @mumuy on GitHub">Follow @mumuy</a> <a class="github-button" href="https://github.com/mumuy" data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="large" aria-label="Follow @mumuy on GitHub">Follow @mumuy</a>
<a class="github-button" href="https://github.com/mumuy/data_location/fork" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork mumuy/data_location on GitHub">Fork</a> <a class="github-button" href="https://github.com/mumuy/data_location/fork" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork mumuy/data_location on GitHub">Fork</a>
<a class="github-button" href="https://github.com/mumuy/data_location" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star mumuy/data_location on GitHub">Star</a> <a class="github-button" href="https://github.com/mumuy/data_location" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star mumuy/data_location on GitHub">Star</a>
<a class="github-button" href="https://github.com/mumuy/data_location/archive/HEAD.zip" data-icon="octicon-download" data-size="large" aria-label="Download mumuy/data_location on GitHub">Download</a> <a class="github-button" href="https://github.com/mumuy/data_location/archive/HEAD.zip" data-icon="octicon-download" data-size="large" aria-label="Download mumuy/data_location on GitHub">Download</a>
</div> </div>
<p>为了及时获取最新最全的行政区划数据,建议你直接引用本项目数据</p> <p>为了及时获取最新最全的行政区划数据,建议你直接引用本项目数据</p>
<p>行政区划最新数据:</p> <p>行政区划最新数据:</p>
<code><a href="https://passer-by.com/data_location/list.json" target="_blank">https://passer-by.com/data_location/list.json</a></code> <code><a href="https://passer-by.com/data_location/list.json" target="_blank">https://passer-by.com/data_location/list.json</a></code>
<p>行政区划历史数据:</p> <p>行政区划历史数据:</p>
<code><a href="https://passer-by.com/data_location/history.json" target="_blank">https://passer-by.com/data_location/history.json</a></code> <code><a href="https://passer-by.com/data_location/history.json" target="_blank">https://passer-by.com/data_location/history.json</a></code>
<p>行政区划变化数据:</p> <p>行政区划变化数据:</p>
<code><a href="https://passer-by.com/data_location/diff.json" target="_blank">https://passer-by.com/data_location/diff.json</a></code> <code><a href="https://passer-by.com/data_location/diff.json" target="_blank">https://passer-by.com/data_location/diff.json</a></code>
<p>行政区划最新数据(含行政管理区)</p> <p>行政区划最新数据(含行政管理区)</p>
<code><a href="https://passer-by.com/data_location/list2.json" target="_blank">https://passer-by.com/data_location/list2.json</a></code> <code><a href="https://passer-by.com/data_location/list2.json" target="_blank">https://passer-by.com/data_location/list2.json</a></code>
</div> </div>
</div> </div>
</div> </div>
<div class="mod-foot"> <script type="text/javascript" src="https://passer-by.com/public/script/projects.js"></script>
<div class="inner"> <div class="mod-foot">
<div class="bd"> <div class="inner">
<p>Copyright &copy; <a href="http://passer-by.com">passer-by.com</a></p> <div class="bd">
</div> <p>Copyright &copy; <a href="http://passer-by.com">passer-by.com</a></p>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="mod-fixedbar">
<script type="text/javascript" src="https://jquerywidget.com/public/script/jquery.min.js"></script> <div class="bd">
<script type="text/javascript" src="https://jquerywidget.com/code/jquery.citys.js"></script> <a href="javascript:;"><img src="static/image/gotop.png" width="24" height="24"></a>
<script type="text/javascript" src="https://jquerywidget.com/code/jquery.suggestion.js"></script> </div>
</div>
</div>
</div>
<script type="text/javascript" src="https://jquerywidget.com/public/script/jquery.min.js"></script>
<script type="text/javascript" src="https://jquerywidget.com/code/jquery.citys.js"></script>
<script type="text/javascript" src="https://jquerywidget.com/code/jquery.suggestion.js"></script>
<script type="text/javascript" src="static/script/locationSearch.js"></script> <script type="text/javascript" src="static/script/locationSearch.js"></script>
<script type="text/javascript" src="https://passer-by.com/idcard/dist/idcard.min.js"></script> <script type="text/javascript" src="https://passer-by.com/idcard/dist/idcard.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
(function(){ (function(){
var listMap = {}; var listMap = {};
var historyMap = {}; var historyMap = {};
var diffMap = {}; // 旧对新 var diffMap = {}; // 旧对新
var diffMap2 = {}; // 新对旧 var diffMap2 = {}; // 新对旧
var $module = $('.mod-panel'); var $module = $('.mod-panel');
var getName = function(code){ var getName = function(code){
var code1 = code.replace(/\d{4}$/,'0000'); var code1 = code.replace(/\d{4}$/,'0000');
var code2 = code.replace(/\d{2}$/,'00'); var code2 = code.replace(/\d{2}$/,'00');
var code3 = code; var code3 = code;
if(code.match(/^(11|12|31|50)\d{4}/)||code.match(/^\d{2}90\d{2}$/)){ if(code.match(/^(11|12|31|50)\d{4}/)||code.match(/^\d{2}90\d{2}$/)){
return (historyMap[code1]||'') + (code2!=code3?(historyMap[code3]||''):''); return (historyMap[code1]||'') + (code2!=code3?(historyMap[code3]||''):'');
}else{ }else{
return (historyMap[code1]||'') + (code1!=code2?(historyMap[code2]||''):'') + (code2!=code3?(historyMap[code3]||''):''); return (historyMap[code1]||'') + (code1!=code2?(historyMap[code2]||''):'') + (code2!=code3?(historyMap[code3]||''):'');
} }
}; };
var isValid = function(id){ var isValid = function(id){
id = id.toLowerCase(); id = id.toLowerCase();
var id17 = id.substr(0,17); var id17 = id.substr(0,17);
var last = id.charAt(17); var last = id.charAt(17);
var sum = 0; var sum = 0;
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
id17.split('').forEach(function(value,index){ id17.split('').forEach(function(value,index){
sum += factor[index]*value; sum += factor[index]*value;
}); });
var lastLetter = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]; var lastLetter = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
var mod = sum%lastLetter.length; var mod = sum%lastLetter.length;
return lastLetter[mod]==last; return lastLetter[mod]==last;
}; };
// 当前数据统计 // 当前数据统计
$.getJSON('https://passer-by.com/data_location/list.json',function(map){ $.getJSON('https://passer-by.com/data_location/list.json',function(map){
listMap = map; listMap = map;
var city1 = 0,city2 = 0,city3 = 0,city4 = 0; var city1 = 0,city2 = 0,city3 = 0,city4 = 0;
var county1 = 0,county2 = 0,county3 = 0,county4 = 0,county5 = 0,county6 = 0,county7 = 0,county8 = 0; var county1 = 0,county2 = 0,county3 = 0,county4 = 0,county5 = 0,county6 = 0,county7 = 0,county8 = 0;
for(var code in listMap){ for(var code in listMap){
if(code.match(/00$/)&&!code.match(/0000$/)&&code<'710000'){ if(code.match(/00$/)&&!code.match(/0000$/)&&code<'710000'){
if(listMap[code].match(/市$/)){ if(listMap[code].match(/市$/)){
city1++; city1++;
}else if(listMap[code].match(/地区$/)){ }else if(listMap[code].match(/地区$/)){
city2++; city2++;
}else if(listMap[code].match(/自治州$/)){ }else if(listMap[code].match(/自治州$/)){
city3++; city3++;
}else if(listMap[code].match(/盟$/)){ }else if(listMap[code].match(/盟$/)){
city4++; city4++;
} }
}else if(!code.match(/00$/)&&!code.match(/0000$/)&&code<'710000'){ }else if(!code.match(/00$/)&&!code.match(/0000$/)&&code<'710000'){
if(listMap[code].match(/市$/)){ if(listMap[code].match(/市$/)){
county2++; county2++;
}else if(listMap[code].match(/特区$/)){ }else if(listMap[code].match(/特区$/)){
county7++; county7++;
}else if(code.match(/90\d{2}$/)&&listMap[code].match(/林区$/)){ }else if(code.match(/90\d{2}$/)&&listMap[code].match(/林区$/)){
county8++; county8++;
}else if(listMap[code].match(/区$/)){ }else if(listMap[code].match(/区$/)){
county1++; county1++;
}else if(listMap[code].match(/自治县$/)){ }else if(listMap[code].match(/自治县$/)){
county4++; county4++;
}else if(listMap[code].match(/县$/)){ }else if(listMap[code].match(/县$/)){
county3++; county3++;
}else if(listMap[code].match(/自治旗$/)){ }else if(listMap[code].match(/自治旗$/)){
county6++; county6++;
}else if(listMap[code].match(/旗$/)){ }else if(listMap[code].match(/旗$/)){
county5++; county5++;
} }
} }
} }
$module.find('.city1').text(city1); $module.find('.city1').text(city1);
$module.find('.city2').text(city2); $module.find('.city2').text(city2);
$module.find('.city3').text(city3); $module.find('.city3').text(city3);
$module.find('.city4').text(city4); $module.find('.city4').text(city4);
$module.find('.county1').text(county1); $module.find('.county1').text(county1);
$module.find('.county2').text(county2); $module.find('.county2').text(county2);
$module.find('.county3').text(county3); $module.find('.county3').text(county3);
$module.find('.county4').text(county4); $module.find('.county4').text(county4);
$module.find('.county5').text(county5); $module.find('.county5').text(county5);
$module.find('.county6').text(county6); $module.find('.county6').text(county6);
$module.find('.county7').text(county7); $module.find('.county7').text(county7);
$module.find('.county8').text(county8); $module.find('.county8').text(county8);
var searchItem = new locationSearch(map); var searchItem = new locationSearch(map);
$location = $('.mod-panel input[name="location"]').suggestion({ $location = $('.mod-panel input[name="location"]').suggestion({
dynamic:false, dynamic:false,
autoSubmit:false, autoSubmit:false,
onCallback:function(){ onCallback:function(){
var location = $location.val(); var location = $location.val();
if(location){ if(location){
result = searchItem.query(location); result = searchItem.query(location);
if(result.length>10){ if(result.length>10){
result = 10; result = 10;
} }
return result; return result;
} }
return []; return [];
} }
}); });
}); });
// 行政区划历史查询 // 行政区划历史查询
$.getJSON('https://passer-by.com/data_location/history.json',function(map){ $.getJSON('https://passer-by.com/data_location/history.json',function(map){
historyMap = map; historyMap = map;
$.getJSON('https://passer-by.com/data_location/diff.json',function(map){ $.getJSON('https://passer-by.com/data_location/diff.json',function(map){
diffMap = map; diffMap = map;
for(var code in diffMap){ for(var code in diffMap){
diffMap[code].forEach(function(value){ diffMap[code].forEach(function(value){
if(typeof diffMap2[value]=='undefined'){ if(typeof diffMap2[value]=='undefined'){
diffMap2[value] = []; diffMap2[value] = [];
} }
diffMap2[value].push(code); diffMap2[value].push(code);
}); });
} }
var $location = $('#location'); var $location = $('#location');
$location.citys({ $location.citys({
'code':'110101', 'code':'110101',
'onChange':function(data){ 'onChange':function(data){
var code = data['code'].toString(); var code = data['code'].toString();
var trs_html = []; var trs_html = [];
if(diffMap2[code]){ if(diffMap2[code]){
trs_html = diffMap2[code].map(function(value){ trs_html = diffMap2[code].map(function(value){
return '<tr><td>'+value+'</td><td>'+getName(value)+'</td></tr>'; return '<tr><td>'+value+'</td><td>'+getName(value)+'</td></tr>';
}); });
$location.find('.table-inner').html('<table><caption>当前行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td>'+code+'</td><td>'+getName(code)+'</td></tr></tbody></table>\ $location.find('.table-inner').html('<table><caption>当前行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td>'+code+'</td><td>'+getName(code)+'</td></tr></tbody></table>\
<table><caption>历史行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody>'+trs_html.join('')+'</tbody></table>'); <table><caption>历史行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody>'+trs_html.join('')+'</tbody></table>');
}else{ }else{
$location.find('.table-inner').html('<table><caption>当前行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td>'+code+'</td><td>'+getName(code)+'</td></tr></tbody></table>\ $location.find('.table-inner').html('<table><caption>当前行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td>'+code+'</td><td>'+getName(code)+'</td></tr></tbody></table>\
<table><caption>历史行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td colspan="2" align="center">暂无数据</td></tr></tbody></table>'); <table><caption>历史行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td colspan="2" align="center">暂无数据</td></tr></tbody></table>');
} }
} }
}); });
var $idcard = $('#idcard'); var $idcard = $('#idcard');
$idcard.find('form').on('submit',function(){ $idcard.find('form').on('submit',function(){
var $this = $(this); var $this = $(this);
var id = $this.find('input[name="id"]').val(); var id = $this.find('input[name="id"]').val();
var result = idcard(id); var result = idcard(id);
if(!result){ if(!result){
alert('身份证号码格式错误!'); alert('身份证号码格式错误!');
}else{ }else{
var newAddress = ''; var newAddress = '';
if(diffMap[code]){ if(diffMap[code]){
newAddress = `<tr> newAddress = `<tr>
<td class="th"><span>现所属地</span></td> <td class="th"><span>现所属地</span></td>
<td>${diffMap[code].map(function(value){return '<p>'+getName(value)+'</p>';})}</td> <td>${diffMap[code].map(function(value){return '<p>'+getName(value)+'</p>';})}</td>
</tr>`; </tr>`;
} }
$idcard.find('.table-inner').html(`<table> $idcard.find('.table-inner').html(`<table>
<tbody> <tbody>
<tr><td class="th" width="25%">证件类型</td><td>${result['type']}</td></tr> <tr><td class="th" width="25%">证件类型</td><td>${result['type']}</td></tr>
<tr><td class="th">国籍</td><td>${result['country']}</td></tr> <tr><td class="th">国籍</td><td>${result['country']}</td></tr>
<tr><td class="th">首次签发地</td><td>${result['sign']}</td></tr> <tr><td class="th">首次签发地</td><td>${result['sign']}</td></tr>
${newAddress} ${newAddress}
<tr><td class="th">出生日期</td><td>${result['birthday'].replace(/(\d{4})(\d{2})(\d{2})/,'$1年$2月$3日')}</td></tr> <tr><td class="th">出生日期</td><td>${result['birthday'].replace(/(\d{4})(\d{2})(\d{2})/,'$1年$2月$3日')}</td></tr>
<tr><td class="th">性别</td><td>${result['sex']}</td></tr> <tr><td class="th">性别</td><td>${result['sex']}</td></tr>
<tr><td class="th">有效性</td><td>${(result['isValid']?'<span class="text-green">有效</span>':'<span class="text-red">无效</span>')}</td></tr> <tr><td class="th">有效性</td><td>${(result['isValid']?'<span class="text-green">有效</span>':'<span class="text-red">无效</span>')}</td></tr>
</tbody> </tbody>
</table>`); </table>`);
} }
return false; return false;
}); });
}); });
}); });
})();
// 底部滚动
(function () {
})(); let timer = null;
</script> let $gotop = document.querySelector('.mod-fixedbar a');
<script async defer src="https://cdn.bootcdn.net/ajax/libs/github-buttons/2.21.1/buttons.min.js"></script> $gotop.addEventListener('click', function () {
<script type="text/javascript" src="https://passer-by.com/public/script/projects.js"></script> cancelAnimationFrame(timer);
<script type="text/javascript" src="https://passer-by.com/public/script/stat.js"></script> let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
</body> let move = scrollTop / 18;
timer = requestAnimationFrame(function fn() {
var oTop = document.body.scrollTop || document.documentElement.scrollTop;
if (oTop > 0) {
document.body.scrollTop = document.documentElement.scrollTop = oTop - move;
timer = requestAnimationFrame(fn);
} else {
cancelAnimationFrame(timer);
}
});
});
})();
</script>
<script async defer src="https://cdn.bootcdn.net/ajax/libs/github-buttons/2.21.1/buttons.min.js"></script>
<script type="text/javascript" src="https://passer-by.com/public/script/stat.js"></script>
</body>
</html> </html>

BIN
static/image/gotop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

View File

@ -500,6 +500,40 @@ a:hover{
line-height: 30px; line-height: 30px;
} }
.mod-fixedbar .bd {
position: fixed;
right: 20px;
bottom: 20px;
z-index: 99;
}
.mod-fixedbar .bd a{
position: relative;
display: block;
width: 48px;
height: 48px;
margin-bottom: 2px;
background: rgba(255,255,255,0.8);
border: 1px solid #f0f0f0;
line-height: 48px;
text-align: center;
}
.mod-fixedbar .bd .popup{
display: none;
position: absolute;
right: 50px;
bottom: 0;
z-index: 99;
border: 1px solid #f0f0f0;
box-shadow: 0 0 2px 0 rgba(0,0,0,0.05);
}
.mod-fixedbar .bd a:hover{
background: rgba(255,255,255,0.9);
}
.mod-fixedbar .bd a:hover .popup{
display: block;
}
@media screen and (max-width: 1020px) { @media screen and (max-width: 1020px) {
.header{ .header{
margin-bottom: 10px; margin-bottom: 10px;
@ -577,4 +611,14 @@ a:hover{
.mod-panel .bd .btn{ .mod-panel .bd .btn{
min-width: 64px; min-width: 64px;
} }
.mod-fixedbar .bd {
right: 10px;
bottom: 10px;
}
.mod-fixedbar .bd a{
width: 36px;
height: 36px;
line-height: 36px;
}
} }