baidu 快递查询API
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>百度快递查询接口Demo</title>
- <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
- </head>
- <script type="text/javascript">
- var strUrl = "http://baidu.kuaidi100.com/query";
- var typeValue = "tiantian", postIdValue = "";
- typeValue = getCompanyCode("天天");
- var gQueryType = ; //查询类型,4为百度查询
- var type;
- var postid;
- var isvalide;
- var havereturn = false;
- var statuscode = ;
- var req;
- var ischoose = false;
- var returnjson;
- var returnjson_up = [];
- var returnjson_down = [];
- var gSortStatus = ;
- var queryurl = '';
- var isavailable = ;
- var gIsCheck;
- var t;
- getResult();
- function $(id) { return document.getElementById(id) }
- function getCompanyCode(name) {
- var companyList = []; // 快递公司名 | 快递公司对应查询快递单号名
- companyList.push("EMS|ems");
- companyList.push("申通|shentong");
- companyList.push("圆通|yuantong");
- companyList.push("中通|zhongtong");
- companyList.push("汇通|huitongkuaidi");
- companyList.push("E邮宝|ems");
- companyList.push("UPS|ups");
- companyList.push("顺丰|shunfeng");
- companyList.push("韵达|yunda");
- companyList.push("天天|tiantian");
- companyList.push("宅急送|zhaijisong");
- companyList.push("邮政包裹|youzhengguonei");
- companyList.push("AAE|aae");
- companyList.push("安信达|anxindakuaixi");
- companyList.push("BHT|bht");
- companyList.push("百福东方|aae");
- companyList.push("包裹/平邮/挂号信|youzhengguonei");
- companyList.push("COE|coe");
- companyList.push("CCES(希伊艾斯)|cces");
- companyList.push("DHL|dhl");
- companyList.push("大田|datianwuliu");
- companyList.push("德邦|debangwuliu");
- companyList.push("D速|dsukuaidi");
- companyList.push("递四方|disifang");
- companyList.push("飞康达|feikangda");
- companyList.push("FedEx(国际)|fedex");
- companyList.push("凡客|rufengda");
- companyList.push("能达速递|ganzhongnengda");
- companyList.push("挂号信|youzhengguonei");
- companyList.push("共速达|gongsuda");
- companyList.push("京广|jinguangsudikuaijian");
- companyList.push("佳吉|jiajiwuliu");
- companyList.push("佳怡|jiayiwuliu");
- companyList.push("急先达|jixianda");
- companyList.push("龙邦|longbanwuliu");
- companyList.push("联昊通|lianhaowuliu");
- companyList.push("联邦快递(国内)|lianbangkuaidi");
- companyList.push("全一|quanyikuaidi");
- companyList.push("全晨|quanchenkuaidi");
- companyList.push("全日通|quanritongkuaidi");
- companyList.push("全峰|quanfengkuaidi");
- companyList.push("速尔|suer");
- companyList.push("盛辉|shenghuiwuliu");
- companyList.push("申通E物流|shentong");
- companyList.push("穗佳物流|suijiawuliu");
- companyList.push("TNT|tnt");
- companyList.push("天地华宇|tiandihuayu");
- companyList.push("特快专递|ems");
- companyList.push("新邦|xinbangwuliu");
- companyList.push("信丰|xinfengwuliu");
- companyList.push("鑫飞鸿|xinhongyukuaidi");
- companyList.push("星晨急便|xingchengjibian");
- companyList.push("优速|youshuwuliu");
- companyList.push("运通|yuntongkuaidi");
- companyList.push("源伟丰|yuanweifeng");
- companyList.push("远成|yuanchengwuliu");
- companyList.push("越丰|yuefengwuliu");
- companyList.push("亚风|yafengsudi");
- companyList.push("元智捷诚|yuanzhijiecheng");
- companyList.push("邮政国内包裹|youzhengguonei");
- companyList.push("邮政国际包裹|youzhengguoji");
- companyList.push("中铁快运|zhongtiewuliu");
- companyList.push("中邮物流|zhongyouwuliu");
- var companyCode = "";
- var flag = false;
- for (var i = ; i < companyList.length; i++) {
- var values = companyList[i].split("|");
- var companyNames = values[].split("/");
- for (var j = ; j < companyNames.length; j++) {
- if (companyNames[j].indexOf(name) >= ) {
- flag = true;
- companyCode = values[];
- break;
- }
- }
- if (flag) {
- break;
- }
- }
- return companyCode;
- }
- function getResult() {
- var url = strUrl + "?type=" + typeValue + "&postid=" + postIdValue + "&id=" + gQueryType;
- if (window.XMLHttpRequest) {
- req = new XMLHttpRequest()
- } else if (window.ActiveXObject) {
- req = new ActiveXObject("Microsoft.XMLHTTP")
- }
- if (req) {
- req.open("GET", url, true);
- req.onreadystatechange = complete;
- req.send(null);
- }
- }
- function complete() {
- if (req.readyState == ) {
- if (req.status == ) {
- if (!havereturn) {
- var resultcontext = req.responseText;
- var json = eval("(" + resultcontext + ")");
- statuscode = json.status;
- gIsCheck = ;
- if (json.status == ) { //如果查询成功 20121011
- gIsCheck = json.ischeck;
- returnjson = json;
- returnjson_up = [];
- returnjson_down = [];
- for (var i in json.data) {
- returnjson_up[i] = json.data[i];
- returnjson_down[i] = json.data[i];
- }
- for (var i = ; i < returnjson_down.length / ; i++) {
- var tmp = returnjson_down[i];
- returnjson_down[i] = returnjson_down[returnjson_down.length - i - ];
- returnjson_down[returnjson_down.length - i - ] = tmp;
- }
- $("showcontext").style.display = "block";
- var data = json.data;
- totalcount = data.length;
- currentpage = ;
- fenye(currentpage);
- } else {
- $("errordiv").style.display = "block";
- $("errorMessage").innerHTML = "此单号无记录,请核对快递公司名称和运单号码是否正确!";
- }
- //refreshcode();
- }
- }
- }
- }
- //排序
- function sortToggle() {
- if (gSortStatus == ) {
- gSortStatus = ;
- sortup();
- } else {
- gSortStatus = ;
- sortdown();
- }
- }
- function sortup() {
- var table = $("showtablecontext");
- while (table.rows.length > ) {
- table.deleteRow();
- }
- returnjson.data = returnjson_up;
- $("b-down").className = "b-down";
- $("b-up").className = "b-up b-up-active";
- fenye();
- }
- function sortdown() {
- var table = $("showtablecontext");
- while (table.rows.length > ) {
- table.deleteRow();
- }
- returnjson.data = returnjson_down;
- $("b-down").className = "b-down b-down-active";
- $("b-up").className = "b-up";
- fenye();
- }
- function fenye(currentpage) {
- var json = returnjson;
- if (json == null) {
- return;
- }
- var data = json.data;
- var obj = json;
- var pagecount = ;
- var pagesize = ;
- if (isvalide) pagesize = ;
- var totalcount = data.length;
- if ((totalcount % pagesize) == ) {
- pagecount = parseInt(totalcount / pagesize);
- } else {
- pagecount = parseInt(totalcount / pagesize) + ;
- }
- var data = json.data;
- var height_table = ;
- var table = $("showtablecontext");
- while (table.rows.length > ) {
- table.deleteRow();
- }
- for (var i = (currentpage - ) * pagesize; i < currentpage * pagesize; i++) {
- if (i > (totalcount - )) break;
- if (isvalide) height_table = ;
- if ((height_table + table.clientHeight) > ) {
- $("fenye").style.display = "block";
- break;
- }
- var newTr = table.insertRow(-);
- var newTd0 = newTr.insertCell(-);
- var newTd1 = newTr.insertCell(-);
- newTd0.innerHTML = data[i].time;
- newTd1.innerHTML = data[i].context;
- var strlength = ;
- if (newTr.clientHeight > ) {
- if (data[i].context.length > strlength) {
- newTd1.innerHTML = data[i].context;
- newTd1.innerHTML = newTd1.innerHTML.substring(, strlength) + "...";
- strlength = strlength - ;
- newTd1.title = data[i].context;
- }
- }
- if (gSortStatus == && i == ) {
- newTd0.className = "nobg c-g-a fontorange";
- newTd1.className = "nobg c-g-b fontorange";
- newTd1.innerHTML += '<span class="lastTag"></span>';
- } else if (gSortStatus == && i == totalcount - ) {
- newTd0.className = "nobg c-g-a fontorange";
- newTd1.className = "nobg c-g-b fontorange";
- newTd1.innerHTML += '<span class="lastTag"></span>';
- } else {
- newTd0.className = "nobg c-g-a";
- newTd1.className = "nobg c-g-b";
- }
- if ((height_table + table.clientHeight) > ) {
- table.deleteRow();
- break;
- }
- }
- var sbufferContext = "";
- if (pagecount == ) {
- $("fenye").innerHTML = sbufferContext;
- $("fenye").style.display = "block";
- return;
- } else {
- $("fenye").style.display = "block";
- }
- var list = "";
- if (pagecount <= ) {
- for (var i = ; i <= pagecount; i++) {
- if (i == currentpage) {
- list += "<a href='javascript:void(0)' class='divpaging-a-number2' >" + i + "</a>";
- } else {
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(" + i + ")'>" + i + "</a>";
- }
- }
- } else if (pagecount > ) {
- if (currentpage <= ) {
- for (var i = ; i <= ; i++) {
- if (i == currentpage) {
- list += "<a href='javascript:void(0)' class='divpaging-a-number2' >" + i + "</a>";
- } else {
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(" + i + ")'>" + i + "</a>";
- }
- }
- list += "<span class='divpaging-span2'>...</span>";
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(" + pagecount + ")' >" + pagecount + "</a>";
- } else if (currentpage <= pagecount - ) {
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(1)' >1</a>";
- list += "<span class='divpaging-span2'>...</span>";
- for (var i = currentpage - ; i <= currentpage + ; i++) {
- if (i == currentpage) {
- list += "<a href='javascript:void(0)' class='divpaging-a-number2' >" + i + "</a>";
- } else {
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(" + i + ")'>" + i + "</a>";
- }
- }
- list += "<span class='divpaging-span2'>...</span>";
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(" + pagecount + ")' >" + pagecount + "</a>";
- } else if (currentpage > pagecount - ) {
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(1)' >1</a>";
- list += "<span class='divpaging-span2'>...</span>";
- for (var i = pagecount - ; i <= pagecount; i++) {
- if (i == currentpage) {
- list += "<a href='javascript:void(0)' class='divpaging-a-number2' >" + i + "</a>";
- } else {
- list += "<a href='javascript:void(0)' class='divpaging-a-number1' onclick='fenye(" + i + ")'>" + i + "</a>";
- }
- }
- }
- }
- $("fenye").innerHTML = list.toString();
- }
- </script>
- <style type="text/css">
- body
- {
- background: #ffffff;
- }
- *
- {
- margin: 0px;
- padding: 0px;
- }
- .round_gray_new { padding:0px 0px 0px 10px; clear:both; width:514px }
- .xboxcontent_a { display:block; background:#FFFAE2; border:0px solid #F5E190; border-width:0px 1px; padding:8px 15px }
- .xboxcontent_a p { margin:0px; padding:0px; line-height:30px; font-size:14px; font-weight:bold; color:#F00 }
- .xboxcontent_a dt { line-height:30px }
- .xboxcontent_a dd { line-height:20px; font-family:"瀹嬩綋"; }
- .xboxcontent_a a { color:#0A8ECE; font-weight:bold }
- .divpaging
- {
- font-size: 12px;
- line-height: 16px;
- text-align: center;
- vertical-align: middle;
- margin: 5px 0px 0px 10px;
- }
- .divpaging a
- {
- float: left;
- }
- .divpaging span
- {
- float: left;
- }
- .divpaging .divpaging-a-number1
- {
- border: #cee3f2 1px solid;
- padding: 1px 6px 1px 6px;
- color: #2477b3;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-a-number1:hover
- {
- border: #fd6d01 1px solid;
- padding: 1px 6px 1px 6px;
- color: #fd6d01;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-a-number2
- {
- border: none;
- padding: 2px 7px 2px 7px;
- color: #e63922;
- margin: 2px 1px 2px 2px;
- font-weight: bold;
- }
- .divpaging .divpaging-a-number3
- {
- border: #2477b3 1px solid;
- background: #2477b3;
- padding: 1px 6px 1px 6px;
- color: #ffffff;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-a-number3:hover
- {
- border: #fd6d01 1px solid;
- background: #ffffff;
- padding: 1px 6px 1px 6px;
- color: #fd6d01;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-a-button
- {
- border: #cee3f2 1px solid;
- padding: 1px 6px 1px 6px;
- color: #2477b3;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-a-button:hover
- {
- border: #fd6d01 1px solid;
- padding: 1px 6px 1px 6px;
- color: #fd6d01;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-span1
- {
- border: #c0c7cc 1px solid;
- padding: 1px 6px 1px 6px;
- color: #c0c7cc;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-span2
- {
- border: none;
- padding: 2px 6px 2px 6px;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-span3
- {
- border: none;
- padding: 2px 0px 2px 10px;
- color: #c0c7cc;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-span4
- {
- border: none;
- padding: 2px 6px 2px 0px;
- color: #c0c7cc;
- margin: 2px 1px 2px 2px;
- }
- .divpaging .divpaging-input1
- {
- float: left;
- border: #cee3f2 1px solid;
- width: 32px;
- height: 18px;
- margin: 2px;
- text-align: center;
- color: #2477b3;
- font-size: 12px;
- }
- .kd-result-new
- {
- padding: 10px;
- float: left;
- width: 514px;
- }
- #showtablecontext
- {
- background: #ffffff;
- }
- #showtablecontext .b-btn
- {
- float: right;
- position: relative;
- }
- #showtablecontext b
- {
- font-size: ;
- height: ;
- line-height: ;
- overflow: hidden;
- position: absolute;
- width: ;
- }
- #showtablecontext .b-up
- {
- border-color: transparent transparent #C9C4CA;
- border-style: dashed dashed solid;
- border-width: 4px;
- border-width: 5px \;
- right: 5px;
- right: 4px \;
- top: 4px;
- top: 1px \;
- }
- #showtablecontext .b-down
- {
- border-color: #C9C4CA transparent transparent;
- border-style: solid dashed dashed;
- border-width: 4px;
- right: 5px;
- top: 17px;
- top: 15px \;
- }
- #showtablecontext .b-up-active
- {
- border-color: transparent transparent #FFFFFF;
- }
- .bluebg
- {
- background: #64AADB;
- border: #75C2EF 1px solid;
- height: 28px;
- line-height: 28px;
- color: #FFFFFF;
- font-weight: bold;
- text-indent: 15px;
- }
- .nobg
- {
- border: 1px solid #DDDDDD;
- font-size: 12px;
- line-height: 22px;
- padding: 3px 5px;
- vertical-align: top;
- }
- .fontorange
- {
- color: #FF6600;
- }
- .lastTag
- {
- margin-left: 5px;
- display: inline-block;
- width: 22px;
- height: 9px;
- background: url("http://cdn.kuaidi100.com/images/frame/baidu/synastry_pics.gif") -251px -49px no-repeat;
- vertical-align: top;
- }
- </style>
- <body>
- <div class="round_gray_new" id="errordiv" style="display: none; clear: both;">
- <b class="xtop"><b class="xb1a"></b><b class="xb2a"></b><b class="xb3a"></b><b class="xb4a">
- </b></b>
- <div class="xboxcontent_a">
- <p style="line-height: 25px; margin: 0px; padding: 0px;">
- <font id="errorMessage">您输入的验证码错误,请重新输入!</font></p>
- </div>
- <b class="xbottom"><b class="xb4a"></b><b class="xb3a"></b><b class="xb2a"></b><b
- class="xb1a"></b></b>
- </div>
- <div class="kd-result-new" id="showcontext" style="display: none;">
- <table width="" border="" cellspacing="" cellpadding="" id="showtablecontext">
- <tr>
- <td width="27%" class="bluebg" onclick="sortToggle()" style="cursor: pointer">
- <span class="b-btn"><b class="b-up b-up-active" id="b-up"></b><b class="b-down" id="b-down">
- </b></span>时间
- </td>
- <td width="73%" class="bluebg">
- 地点和跟踪进度
- </td>
- </tr>
- </table>
- <div class="divpaging" id="fenye">
- </div>
- </div>
- </body>
- </html>
您输入的验证码错误,请重新输入!
时间 | 地点和跟踪进度 |
baidu 快递查询API的更多相关文章
- 快递查询API接口对接方法
各类接口 快递查询API有即时查询和订阅查询两种,即时是请求即返回数据,订阅则是订阅快递单号到接口,有物流轨迹更新则全量返回数据.目前常用的有快递鸟.快递100.快递网等. 快递鸟即时API可以查询3 ...
- 快递查询api(多接口方案)
/** 本环境使用php+smarty,结合两种快递api调取快递数据 * 说明,先快递鸟调取数据,失败后再调取快递网的数据* 快递鸟 http://www.kdniao.com 快递网 http:/ ...
- 各种快递查询--Api接口
授权成功我的密钥 爱查快递API使用说明文档 API地址: 以前:http://api.ickd.cn/?com=[]&nu=[]&id=[]&type=[]&enco ...
- 快递查询API接口(trackingmore)
快递查询接口 目前提供快递查询的接口平台有: Trackingmore 快递100 快递网 不同接口的区别: (1)Trackingmore支持380家快递公司,其中有55家为国内的快递,其余325家 ...
- 常用免费快递查询API对接案例
现在许多电商公司和ERP都会寻找比较适用的集成快递查询接口,减少对接难度,现在整理一下常用的免费快递查询接口,并附上调用案例,如果有觉得不对的地方,望能够一起沟通探讨! 一.快递查询接口 目前有提供免 ...
- 自动化测试===unittest和requests接口测试案例,测试快递查询api(二)
在原来基础上生成测试报告: 首先需要 HTMLTestRunner.py 的unittest生成报告文件 (源码,自动化测试===unittest配套的HTMLTestRunner.py生成html ...
- 快递查询API接口集成,有需要的可以直接用
适用于涉及经常发货.寄快递的人群.企业.电商网站.微信公众号平台等对接使用.支持国内外三百多家快递及物流公司的快递单号一站式查询. 使用说明: 1.KuadidiAPI.php 不需要修改改任何东西 ...
- 快递查询API
https://market.aliyun.com/products/56928004/cmapi014394.html#sku=yuncode839400000
- python爬虫入门之快递查询
现在快递遍布生活的角角落落,一个快递其实是信息的集合体,里面包含大量的物流信息,那能不能自己实现一个快递查询的小功能?答案是能的!现在也有别人整理好的快递查询api,比如说快递100,可以通过它提供的 ...
随机推荐
- oracle ebs 采购订单关闭之PL/SQL实现方法
应客户需求,需要写个脚本,批量关闭Bonus Item类型的采购订单,在metalink上搜索到一些方法,但是都测试不通.原来需要将代码生成一个并发程序.下面是测试成功的代码. 1.首先创建一个存储过 ...
- Mysql索引总结(一)
数据库开发中索引的使用占了很重要的位置,好的索引会使数据库的读写效率加倍,烂的索引则会拖累整个系统甚至引发灾难. 索引分三类: index ----普通的索引,数据可以重复 unique ----唯一 ...
- 夺命雷公狗—angularjs—10—angularjs里面的内置函数
我们没学一门语言或者框架,几乎里面都有各自的语法和内置函数,当然,强悍的angularjs也不例外,他的方法其实常用的没多少,因为很多都可以用源生jis几乎都能完成一大部分.. <!doctyp ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetLineStyle2
zw版[转发·台湾nvp系列Delphi例程]HALCON SetLineStyle2 procedure TForm1.Button1Click(Sender: TObject);var img : ...
- UIViewController卸载过程(ios6.0以后)
在ios6.0以后,废除了viewWillUnload方法和viewDidUnload方法. 在ios6以后,当收到didReceiveMemoryWarning消息调用之后,程序会自动调用didRe ...
- Multi-source Replication
MariaDB starting with 10.0.1 Multi-source replication means that one server has many masters from wh ...
- Zero_qiqi DIV模式的省市区三级联动
1].[代码] [HTML]代码 跳至 [1] [2] [3] [4] [5] [6] ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...
- centos7重启rsyslog服务|centos7重启syslog服务
centos7重启rsyslog服务: systemctl restart rsyslog 使用:(killall无效) killall -HUP rsyslog
- Cacti Install
一.Cacti简介 Cacti是通过snmpget来获取数据,使用RRDtool绘画图形,而且你完全可以不需要了解RRDtool复杂的参数.它提供了非常强大的数据和用户管理功能,可以指定每一个用户能查 ...
- 关于left join、right join和inner join
总结, 1.select * from A left join B on A.XX=B.XX 左侧显示A的列名,右侧显示B的列名 左侧,显示A表的所有列 右侧, A.XX=B.XX的时候,显示B表的列 ...