物流公司列表
<h5>简要描述</h5>
<ul>
<li>无</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>https://52.yunhu365.com/ErpServer/h5api/12116/st0908_1</code> </li>
</ul>
<h5>请求方式</h5>
<ul>
<li>post</li>
</ul>
<h5>Header</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">header</th>
<th style="text-align: left;">必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">sign</td>
<td style="text-align: left;">是</td>
<td>string</td>
<td>上传的json字符串经过md5签名的值</td>
</tr>
<tr>
<td style="text-align: left;">token</td>
<td style="text-align: left;">是</td>
<td>string</td>
<td>登录成功后返回的用户token,登录前传入空字符串</td>
</tr>
</tbody>
</table>
<h5>请求参数示例</h5>
<pre><code>{
"actionName": "expressList",
"userid": 1
}
</code></pre>
<h5>json字段说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">字段名</th>
<th style="text-align: left;">必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">actionName</td>
<td style="text-align: left;">是</td>
<td>string</td>
<td>固定传expressList</td>
</tr>
<tr>
<td style="text-align: left;">userid</td>
<td style="text-align: left;">是</td>
<td>int</td>
<td>用户ID,必须要已经登录</td>
</tr>
</tbody>
</table>
<h5>成功返回示例</h5>
<pre><code>{
"code": 1,
"msg": "",
"actionName": "expressList",
"data": [
{
"id": 1,
"name": "圆通速递"
},
{
"id": 2,
"name": "申通快递"
},
{
"id": 3,
"name": "极兔速递"
},
{
"id": 4,
"name": "中通快递"
},
{
"id": 5,
"name": "韵达快递"
},
{
"id": 8,
"name": "京东物流"
},
{
"id": 10,
"name": "菜鸟速递"
},
{
"id": 11,
"name": "芝麻开门"
},
{
"id": 12,
"name": "德邦快递"
},
{
"id": 13,
"name": "邮政电商标快"
},
{
"id": 14,
"name": "邮政标准快递"
},
{
"id": 15,
"name": "德邦物流"
},
{
"id": 16,
"name": "中通快运"
},
{
"id": 17,
"name": "跨越速运"
},
{
"id": 18,
"name": "安能快运"
},
{
"id": 19,
"name": "顺丰快运"
},
{
"id": 20,
"name": "京东快运"
},
{
"id": 21,
"name": "百世快运"
},
{
"id": 22,
"name": "顺心捷达"
},
{
"id": 23,
"name": "韵达快运"
},
{
"id": 24,
"name": "加运美"
},
{
"id": 25,
"name": "优速"
},
{
"id": 26,
"name": "信丰物流"
},
{
"id": 27,
"name": "壹米滴答"
},
{
"id": 28,
"name": "安得物流"
},
{
"id": 29,
"name": "速必达"
},
{
"id": 30,
"name": "联昊通"
},
{
"id": 31,
"name": "平安达腾飞"
},
{
"id": 33,
"name": "宅急送"
},
{
"id": 37,
"name": "京广速递"
},
{
"id": 39,
"name": "速腾快递"
},
{
"id": 40,
"name": "众邮快递"
},
{
"id": 42,
"name": "海信物流"
},
{
"id": 43,
"name": "百世快递"
},
{
"id": 45,
"name": "安鲜达"
},
{
"id": 46,
"name": "汇森速运"
},
{
"id": 47,
"name": "菜鸟速递"
},
{
"id": 51,
"name": "中铁快运"
},
{
"id": 54,
"name": "宇鑫物流"
},
{
"id": 57,
"name": "龙俊物流"
},
{
"id": 59,
"name": "日日顺物流"
},
{
"id": 61,
"name": "递四方"
},
{
"id": 62,
"name": "安能快递"
},
{
"id": 63,
"name": "速通物流"
},
{
"id": 66,
"name": "百腾物流"
},
{
"id": 69,
"name": "顺丰冷链"
},
{
"id": 70,
"name": "金大物流"
},
{
"id": 71,
"name": "苏宁物流"
},
{
"id": 72,
"name": "雪域易购"
},
{
"id": 73,
"name": "同城快寄"
},
{
"id": 75,
"name": "顺昌国际"
},
{
"id": 76,
"name": "宏递快运"
},
{
"id": 79,
"name": "无忧物流"
},
{
"id": 83,
"name": "威盛快递"
},
{
"id": 84,
"name": "盛辉物流"
},
{
"id": 85,
"name": "新杰物流"
},
{
"id": 88,
"name": "袋鼠速递"
},
{
"id": 92,
"name": "EMS物流"
},
{
"id": 93,
"name": "源安达"
},
{
"id": 95,
"name": "佰纳博通"
},
{
"id": 96,
"name": "聚盟共建"
},
{
"id": 97,
"name": "盛丰物流"
},
{
"id": 98,
"name": "顺丰-繁体"
},
{
"id": 99,
"name": "佳怡物流"
},
{
"id": 100,
"name": "世华通物流"
},
{
"id": 101,
"name": "铁中快运"
},
{
"id": 102,
"name": "荣庆物流"
},
{
"id": 103,
"name": "德坤物流"
},
{
"id": 110,
"name": "佳吉快运"
},
{
"id": 111,
"name": "四季安物流"
},
{
"id": 113,
"name": "中铁飞豹"
},
{
"id": 114,
"name": "安捷物流"
},
{
"id": 115,
"name": "景光物流"
},
{
"id": 117,
"name": "富吉速运"
},
{
"id": 118,
"name": "天天快递"
},
{
"id": 119,
"name": "中通冷链"
},
{
"id": 121,
"name": "豫德隆物流"
},
{
"id": 122,
"name": "天翼快递"
},
{
"id": 123,
"name": "泰进物流"
},
{
"id": 126,
"name": "鑫正一快递"
},
{
"id": 128,
"name": "三志物流"
},
{
"id": 129,
"name": "全联速运"
},
{
"id": 130,
"name": "小米物流"
},
{
"id": 131,
"name": "叁虎物流"
},
{
"id": 132,
"name": "成都捷信安达物流"
},
{
"id": 133,
"name": "快捷快物流"
},
{
"id": 134,
"name": "中集冷云"
},
{
"id": 135,
"name": "君霖永辉物流"
},
{
"id": 136,
"name": "速邮达"
},
{
"id": 137,
"name": "敏華物流"
},
{
"id": 140,
"name": "斑马物流"
},
{
"id": 141,
"name": "高田物流"
},
{
"id": 142,
"name": "新易泰"
},
{
"id": 143,
"name": "邦泰快运"
},
{
"id": 144,
"name": "诚和通"
},
{
"id": 145,
"name": "时安达速递"
},
{
"id": 146,
"name": "鸿泰物流"
},
{
"id": 148,
"name": "百米快运"
},
{
"id": 149,
"name": "大田物流"
},
{
"id": 154,
"name": "邮速达"
}
]
}
</code></pre>
<h5>成功返回示例的参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">string</td>
<td>错误码,1表示成功</td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">string</td>
<td>如果有错误此值不为空,否则值为空字符串</td>
</tr>
<tr>
<td style="text-align: left;">actionName</td>
<td style="text-align: left;">string</td>
<td>无</td>
</tr>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">array</td>
<td>无</td>
</tr>
<tr>
<td style="text-align: left;">id</td>
<td style="text-align: left;">int</td>
<td>物流公司ID</td>
</tr>
<tr>
<td style="text-align: left;">name</td>
<td style="text-align: left;">string</td>
<td>物流公司名称</td>
</tr>
</tbody>
</table>
<h5>失败返回示例</h5>
<pre><code>{
"code": 0,
"msg": "错误信息",
"actionName": "expressList"
}
</code></pre>
<h5>失败返回示例的参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">string</td>
<td>0表示产生错误</td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">string</td>
<td>如果有错误时此值不为空</td>
</tr>
<tr>
<td style="text-align: left;">actionName</td>
<td style="text-align: left;">string</td>
<td>无</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<p><strong>示例代码:</strong> </p>
<pre><code class="language-language"><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
<script>
//全局对象AppConfig存放服务器传来的数据
var AppConfig = {};
AppConfig.serverurl = "http://118.31.32.52/ErpServer/h5api/12116/st0908_1";
AppConfig.token = "";
AppConfig.singkey = "";
AppConfig.userid = 0;//用户登录后服务器传来的用户id
AppConfig.username = "";//用户登录后服务器传来的用户名
AppConfig.shopid = 0;//用户登录后服务器传来的店铺id
AppConfig.shopname = "";//用户登录后服务器传来的店铺名
AppConfig.shoplogo = "";//用户登录后服务器传来的店铺logo
//获取店铺信息
function getshop() {
var obj = new Object();
obj.actionName = "getshop";
postdata(obj);
}
function postdata(obj) {
//将对象obj转换为json字符串
var jsondata = JSON.stringify(obj);
//数据签名
var sign = "";
if (AppConfig.token == null || AppConfig.token.length == 0)
sign = calculateMD5("json=" + jsondata);
else
sign = calculateMD5("json=" + jsondata + "&key=" + AppConfig.singkey + AppConfig.token);
sign = sign.toUpperCase();
//发送请求
var xhr = new XMLHttpRequest();
xhr.open('POST', AppConfig.serverurl, true);
xhr.setRequestHeader('Content-Type', 'application/json');
//在header中传递token
xhr.setRequestHeader('token', AppConfig.token);
//将sign放在header中传递
xhr.setRequestHeader('sign', sign);
xhr.onload = function () {
if (this.status == 200) {
var res = this.responseText;
if (res == null || res.length == 0) {
alert("返回数据为空");
return;
}
document.getElementById("id_error").innerHTML = res;
//解析返回数据
var obj = JSON.parse(res);
if (obj.code == 1) {
debugger;
} else {
alert(obj.msg);
if (obj.code == 2) {
//店铺未上线,跳转店铺建立中的页面
} else if (obj.code == 3) {
//店铺已关闭,跳转到警请期待页面
} else if (obj.code == 4) {
//店铺已到期,跳转到续费页面
} else if (obj.code == 5) {
//请重新登录,跳转到登录页面
} else if (obj.code == 6) {
//超时或未登录,跳转到登录页面
} else if (obj.code == 7) {
//签名不正确,跳转到登录页面
}
}
}
};
//发送数据
xhr.send(jsondata);
}
// 使用 CryptoJS 计算 MD5 哈希值
function calculateMD5(value) {
return CryptoJS.MD5(value).toString();
}
getshop();
</script>
<div id="id_error"></div>
</body>
</html></code></pre>