@lina
2020-08-04T11:53:00.000000Z
字数 7892
阅读 441
列表项
秒云达 1.0 小程序
- 【测试url】http://api.volunteer.alpha.flashdiet.cn/api
- 【线上url】/api
X-auth-token: [string] 登录后获取的token信息, 取window.token 请求头带此字段X-org-code: [string]https://www.zybuluo.com/mdeditor# 机构表识字段,所有请求均需要此字段,取window.orgCode 请求头带此字段X-location: [string] 坐标 lng-lat 请求头带此字段X-unique-key: [string] 服务端下发的标识,取window.uniqueKey 请求头带此字段X-city: [string] 所在城市名称 请求头带此字段X-platform-code: [string] 平台标识字段,所有请求均需要此字段,取window.platformCode 请求头带此字段
- POST请求Content-Type为:Content-Type:application/x-www-form-urlencoded
- 文件上传时Content-Type为:Content-Type:multipart/form-data
- 对于:Content-Type:application/json:Content-Type:application/xml不保证完全支持,请谨慎使用
- 【线上url】待定
- 【测试url】http://api.volunteer.alpha.flashdiet.cn/api/
- 【线上url】/api/
通用图片上传文件服务
请求URL
POST
/imgupload
请求参数
file: 文件
响应
{error_code: 0,data: {url: 'http://xxx'}}
url: [string] 文件的访问URL
注:请求图片时,需解析图片的cookie,不然无法认证
GET
/captcha
POST
/verifycode
请求参数
captcha_code: [string] 图形验证码phone: [string] 手机号
响应
{error_code: 0,data: {}}
error_code: [int] 服务器状态码,0 为正常状态,异常状态待定。error_message:[string] 错误信息,但error_code不为 0 时返回
data: [object] 数据字段,所有响应数据都在此字段中list: [array],当返回数据为列表时会将数据放在该字段
page: [object] 分页信息,当返回数组数据时会携带该字段
current_page: [int] 当前页码,默认为1total_page: [int] 总页数page_size: [int] 每页数量:本项目常用page_size==10
示例
{error_code: 0,data: {key: value,list: [{key: value}],page {}}}
sex:[int]0: 未知
1: 男
2: 女
verify_status:[int]0: 审核中
1: 通过
2: 驳回
status: [int]0:未启用
1:启用
status: [int]0:待抢单
1:已抢单
2:已拒绝
{id: 123,nick_name: '梦里花落知多少',real_name: 'xx',phone: '15500000000',sex: 1,avatars: 'http://image.com/1.jpeg',id_number: 110101198803031321,bank_number: '7112312321',id_card_front: 'url',id_card_back: 'url',sign_photo: 'url',company_id: 12,region_id: 12,bus_quarter_id: 23,department_id: 12,bus_depart_id: 12}
id: [int] 用户IDnick_name: [string] 用户名phone: [string] 用户手机avatars: [string] 头像real_name: [string] 姓名sex: [integer] 性别id_number: [string] 身份证号bank_number: [string] 银行卡号bank_name: [string] 银行名称id_card_front: [string] 身份证正面照片urlid_card_back: [string] 身份证反面照片urlsign_photo: [string] 签字照片company_id: [int] 快递公司idregion_id: [int] 大区idbus_quarter_id: [int] 营业区iddepartment_id: [int] 分部id,可能为空bus_depart_id: [int] 营业部id
{@用户基本信息,token: 'ssadaf',last_month_income: 7777.23,total_income: 121323.23,bonus_left: 12.22, // 可提现奖励金数undo_order: [@待抢订单],company:{@快递公司},region: {@大区},bus_quarter: {@营业区},department: {@分部},bus_depart: {@营业部}}
- @用户基本信息
token: [string] 下发的token,需要每次请求带上last_month_income: [float] 上月收入total_income: [float] 总收入undo_order: [array] 待抢订单列表company: [string] 快递公司信息region: [string] 大区信息bus_quarter: [obj] 营业区信息department: [obj] 分部信息(可能为null)bus_depart: [string] 营业部信息
{id: 12,courier_id: 1232,remark: '中关村南大街',start_time: '7112312321',end_time: 7777.23,status: 0,company:{@快递公司},region: {@大区},bus_quarter: {@营业区},department: {@分部},bus_depart: {@营业部}}
id: [int] 订单IDcourier_id: [string] 快递员用户idremark: [string] 线路备注start_time: [date] 开始时间end_time: [date] 结束时间status: [integer] 订单状态company: [obj] 快递公司信息region: [obj] 大区信息bus_quarter: [obj] 营业区信息department: [obj] 分部信息(可能为null)bus_depart: [obj] 营业部信息
公司
{id: 12,company_name: 1232,contact_name: '中关村南大街',contact_phone: '7112312321',status: 0,province_id: 0,province_name: 0,city_id: 0,city_name: 0,county_id: 0,county_name: 0,addr: 0,}
id: [int] 公司IDcompany_name: [string] 公司名称contact_name: [string] 联系人姓名contact_phone: [string] 联系人电话status: [int] 启用弃用状态province_id: [string] 省份idprovince_name: [string] 省份名称city_id: [string] 城市idcity_name: [string] 城市名称county_id: [string] 区县idcounty_name: [string] 区县名称addr: [string] 具体地址
其他的看数据库吧,就不一一写出来,字段基本都一样的
分部相对于公司等,多个一个后台管理用户对象
{id: 12,department_name: 1232,contact_name: '中关村南大街',contact_phone: '7112312321',status: 0,province_id: 0,province_name: 0,city_id: 0,city_name: 0,county_id: 0,county_name: 0,addr: 0,user: {username: 'xxx'}}
id: [int] 分部IDdepartment_name: [string] 分部名称contact_name: [string] 联系人姓名contact_phone: [string] 联系人电话status: [int] 启用弃用状态province_id: [string] 省份idprovince_name: [string] 省份名称city_id: [string] 城市idcity_name: [string] 城市名称county_id: [string] 区县idcounty_name: [string] 区县名称addr: [string] 具体地址user: [obj] 后台管理对象
营业部就不列出来,字段基本都一样的
请求URL
POST
/ExtsignSelf
请求参数
open_id
响应
@签署合同页面
请求URL
POST
/register
请求参数
photo: [string] 手机号码 【必填】real_name: [string] 真实姓名【必填】verify_code: [string] 验证码 【必填】id_card_front: [string] 身份证正面照片url【必填】id_card_back: [string] 身份证反面照片url【必填】id_number: [string] 身份证号【必填】bank_name: [string] 银行名称【必填】bank_number: [string] 银行卡号号【必填】sign_photo: [string] 签字照片【必填】company_id: [int] 快递公司id【必填】region_id: [int] 大区id【必填】bus_quarter_id: [int] 营业区id【必填】bus_depart_id: [int] 营业部id【必填】token: [string] token【必填】raw_data: wx.getUserInfo返回值iv: wx.getUserInfo返回值signature: wx.getUserInfo返回值encrypted_data: wx.getUserInfo返回值introduce_token: 推荐人的token
响应
{"error_code": 0,"data":{@首页数据},"error_message": ""}
请求URL
GET
/user/info
请求参数
header中X-auth-token为下发的token
响应
{"error_code": 0,"data":{@首页数据},"error_message": ""}
请求URL
GET
/order
请求参数
header中X-auth-token为下发的token
响应
{"error_code": 0,"data":[@订单信息],"error_message": ""}
请求URL
POST
/income
请求参数
header中X-auth-token为下发的token
响应
{"error_code": 0,"data":{"data": {"2018-10": [@收入信息],"2018-09": [@收入信息],},"undraw": {"2018-10-01": 10000, //未提现的单子,总金额"2018-10-16": 10000, //未提现的单子,总金额},"courier": {@快递员信息(包括银行卡等信息)}},"error_message": ""}
请求URL
GET
/company
/region?company_id=1
/bus_quarter?company_id=1®ion_id=1
/bus_depart?company_id=1®ion_id=1&bus_quarter_id=1
请求参数
分别获取公司、大区、营业部、营业区,需要带上各自参数
响应
{"error_code": 0,"data":[@公司、大区、营业部、营业区],"error_message": ""}
请求URL
PUT
/income/all
请求参数
sign_photo: [string]签名图片undraw_arr: [array]未提现财务,为3.1.4接口中下发的undraw的时间数组
响应
{"error_code": 0,"data": null,"error_message": ""}
请求URL
GET
/undoOrder
请求参数
header中X-auth-token为下发的token
page:页码
响应
{"error_code": 0,"data":["list":[@未抢订单信息],"totle":@数据条数],"error_message": ""}
注:此接口有两种返回值,根据响应值的不同,做出相应的操作
请求URL
GET
/weixin/login
请求参数
code: 通过wx.login获取【必填】
响应
注:当用户第一次进入程序时,接口返回session_token,小程序将此值存入strorage。然后调用wx.getUserInfo(withCredentials需传true)后,调用过3.1.1接口获取用户token
跳转到认证注册页面
{"error_code": 0,"data":{'session_token':'aaaa'},"error_message": ""}
响应
注:当后台识别登陆用户后,直接返回用户信息(含token)
{"error_code": 0,"data":{@首页信息},"error_message": ""}
注:小程序特殊处理
请求URL
POST
/miniprogram/verifycode
请求参数
phone: phone【必填】token: token【必填】
响应
{"error_code": 0,"data":{},"error_message": ""}
请求URL
POST
/bank_judge
请求参数
bank_num: [string]【必填】
响应
相应的银行名称,和该银行卡号是否合法
{"error_code": 0,"data":{"bank_name": "招商银行","is_valid": true // 不合法则返回false},"error_message": ""}
必须当日推荐抢单后才能调用
请求URL(请求头需要有token信息)
POST
/checkin
请求参数
X-location: [string] 坐标 lng-lat 请求头带此字段- clock_in_addr 签到地址
响应
签到成功时,data里返回红包的数值,data为空时,则为领取红包失败。
{"error_code": 0,"data": 1.22,"error_message": "签到成功"}
请求URL(请求头需要有token信息)
GET
/order_today
请求参数
无
{"error_code": 0,"data": {// 当日订单信息},"error_message": "签到成功"}
返回的data里多返回了一个own_list(只有第一页返回,其他时为空数组),表示自己待抢单的,不包括今天推荐订单
请求URL(请求头需要有token信息)
GET
/checkin/is_valid
请求参数
X-location: [string] 坐标 lng-lat 请求头带此字段
{"error_code": 0,"data": true, // true表示有效,false表示无效"error_message": "签到成功"}
请求URL(请求头需要有token信息),原来的/income接口不再下发每日数据
GET
/income_by_month
请求参数
month_time: [string] 月份,例如2019-01pageSize: [integer] 分页,默认10page: [integer] 当前页数,默认1
{"error_code": 0,"data": {"list": [{"id": 71,"courier_id": 229,"status": 1,"amount": 600, // 当日收入,已经计算过了"month_time": "2019-01-07 00:00:00","available_withdraw": "0.00","cur_month_already_withdraw": "600.00","cur_month_remain_withdraw": "3500.00","star": 4,"order_desc": "第7次,80个包裹,其中10个重型包裹,超长包裹13,超长距离包裹5个。","bus_require": "妙衡公司","sign_photo": "http://api.ztb.alpha.flashdiet.cn/uploads/2019-01/784631547027035.png","sign_time": "2019-01-09 17:43:56","liability_compensation": null,"platform_award": null}],"total": 25,"total_page": 3,}"error_message": "签到成功"}
根据courier中下发的fdd_head_photo来获取具体的图片,
GET
/fdd_head_photo/{uuid}
请求参数
uuid: [string] 根据courier中下发的fdd_head_photo
返回图片
bus_type字段表示业务类型,为int类型