微信小程序 小程序使用onPathUpdate


本文整理自网络,侵删。

logistics.onPathUpdate

本文档描述服务器端接收的消息或事件,详细说明参见消息推送。

运单轨迹更新事件。当运单轨迹有更新时,会产生如下数据包。收到事件之后,回复success或者空串即可。

消息参数

Object

属性类型说明
ToUserNamestring小程序的原始ID
FromUserNamestring发送者的openid
CreateTimenumber消息创建时间(整型)
MsgTypestring固定 event
Eventstring固定 add_express_path
DeliveryIDstring快递公司ID
WayBillIdstring运单ID
OrderIdstring订单ID
Versionnumber轨迹版本号(整型)
Countnumber轨迹节点数(整型)
ActionsArray.<Object>轨迹列表

Actions 的结构

属性类型说明
ActionTimenumber轨迹节点 Unix 时间戳
ActionTypenumber轨迹节点类型
ActionMsgstring轨迹节点详情

ActionType 的合法值

说明最低版本
100001揽件阶段-揽件成功
100002揽件阶段-揽件失败
100003揽件阶段-分配业务员
200001运输阶段-更新运输轨迹
300002派送阶段-开始派送
300003派送阶段-签收成功
300004派送阶段-签收失败
400001异常阶段-订单取消
400002异常阶段-订单滞留

消息数据包示例

XML 格式

<xml>
  <ToUserName><![CDATA[toUser]]></ToUserName>
  <FromUserName><![CDATA[fromUser]]></FromUserName>
  <CreateTime>1546924844</CreateTime>
  <MsgType><![CDATA[event]]></MsgType>
  <Event><![CDATA[add_express_path]]></Event>
  <DeliveryID><![CDATA[SF]]></DeliveryID>
  <WayBillId><![CDATA[123456789]]></WayBillId>
  <OrderId><![CDATA[123456]]></OrderId>
  <Version>3</Version>
  <Count>3</Count>
  <Actions>
    <ActionTime>1546924840</ActionTime>
    <ActionType>100001</ActionType>
    <ActionMsg><![CDATA[小哥A揽件成功]]></ActionMsg>
  </Actions>
  <Actions>
    <ActionTime>1546924841</ActionTime>
    <ActionType>200001</ActionType>
    <ActionMsg><![CDATA[到达广州集包地]]></ActionMsg>
  </Actions>
  <Actions>
    <ActionTime>1546924842</ActionTime>
    <ActionType>200001</ActionType>
    <ActionMsg><![CDATA[运往目的地]]></ActionMsg>
  </Actions>
</xml>

JSON 格式

{
  "ToUserName": "toUser",
  "FromUserName": "fromUser",
  "CreateTime": 1546924844,
  "MsgType": "event",
  "Event": "add_express_path",
  "DeliveryID": "SF",
  "WayBillId": "123456789",
  "OrderId": "123456789",
  "Version": 2,
  "Count": 3,
  "Actions": [
    {
      "ActionTime": 1546924840,
      "ActionType": 100001,
      "ActionMsg": "小哥A揽件成功"
    },
    {
      "ActionTime": 1546924841,
      "ActionType": 200001,
      "ActionMsg": "到达广州集包地"
    },
    {
      "ActionTime": 1546924842,
      "ActionType": 200001,
      "ActionMsg": "运往目的地"
    }
  ]
}



标签:微信小程序

相关阅读 >>

微信小程序云开发控制台

微信小程序 即时配送接口(商家查看)-附录 1:品类表

微信小程序api 监听实时地理位置

微信小程序云开发服务端数据库api 更新指令

微信小程序云开发api 获取集合的引用

微信小程序 weui弹窗组件

微信小程序api-设备-扫码

微信小程序 小程序使用mockupdateorder

微信小程序云开发服务端存储api 将本地资源上传至云存储空间

微信小程序api 设置导航条

更多相关阅读请进入《微信小程序》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...