文档
测试

小程序ws连接

COPY
wss://test.ssib.gzncloud.com/websocket/ssib/purchase

接口描述

小程序扫码进行购物,连接成功会向设备请求开门

请求参数

参数名
类型
描述
必填
token
String
token校验,之前调用接口生成的
必填
deviceNo
String
设备编号
必填
appId
String
小程序appid
必填

响应参数

参数名
类型
描述
必填
msg
String
提示消息
必填
type
String
type(door:开门,update:购物中列表,final:购物最终列表,failure:失败)表示门的状态。设备会自动推送每次不同的结果
必填
success
String
状态结果:“true”/ “false”
必填
data
String
开门成功后的商品数据
必填
amount
BigDecimal
订单的总金额
必填
tradeNo
String
订单号
必填
isCreditPay
String
是否是免密支付
必填
discounts
ArrayList
优惠列表
必填
createTime
String
订单创建时间
必填
orderInfo
String
手动支付地址
必填
list
ArrayList
消费商品列表
必填
aisleId
Integer
货道id
必填
amount
BigDecimal
该商品的总价格
必填
costPrice
BigDecimal
成本价格
必填
id
Integer
商品id
必填
isBulk
String
计价方式 称重 1 单位 元/斤 * 计件 0 单位 元/件
必填
name
String
商品名称
必填
price
BigDecimal
单价
必填
priceUnit
String
单价单位
必填
quantity
Integer
商品数量
必填
quantityType
String
数量类型
必填
quantityUnit
String
数量单位 称重 : g 计件: 件
必填
thumbImage
String
商品图片地址url
必填
typeName
String
商品类型名称
必填

说明 / 示例

**开门成功返回:** |msg|success|type| |-|-|-| |""|true|"door"| **开门无购物** |data|type| |-|-| |"list":[]|"final"| **失败返回有**: |msg|success|type| |-|-|-| |"操作失败"|false|"failure"| |"由于微信风控原因,订单创建失败,请您尝试支付宝扫码购物。"|false|"failure"| |""|false|"failure"| **final状态** |data|type| |-|-| |data|"final"| **data** |amount|tradeNo|isCreditPay|discounts|createTime|orderInfo|list| |-|-|-|-|-|-|-| |总价|订单号|是否是免密支付|优惠列表|创建时间|手动支付地址|list| **list** |aisleId|amount|costPrice|id|isBulk|name|price|priceUnit|quantity|quantityType|quantityUnit|typeName|thumbImage| |-|-|-|-|-|-|-|-|-|-|-|-|-| |5595|2.43|0.00560|3343|isBulk|"水果"|3.08000|"元/斤"|394|"重量"|"g"|"水果"|图片地址| **update状态实例** { "data": { "amount": 2.43, "list": [{ "aisleId": 5595, "amount": 2.43, "costPrice": 0.00560, "id": 3343, "isBulk": "1", "name": "水果", "price": 3.08000, "priceUnit": "元/斤", "quantity": 394, "quantityType": "重量", "quantityUnit": "g", "thumbImage": "http://ssib.gzncloud.com:10053/upload/image/19090214550243135023.jpg", "typeName": "水果" }] }, "type": "update" } **final状态实例** { "data": { "amount": 15.80, "tradeNo": "19101114451054062737", "isCreditPay": "1", "discounts": [], "createTime": "2019-10-11 14:45:44", "orderInfo": "", "list": [{ "aisleId": 6140, "amount": 15.80, "costPrice": 6.90000, "id": 3462, "isBulk": "0", "name": "华农原味酸牛奶(买二送一)", "price": 7.90000, "priceUnit": "元/件", "quantity": 2, "quantityType": "数量", "quantityUnit": "件", "thumbImage": "http://ssib.gzncloud.com:10053/upload/image/19091215161757769747.jpg", "typeName": "华农酸奶" }] }, "type": "final" }