多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
#简介 通过聚客微信开放接口,第三方的微信点餐服务可以和聚客收银系统连接起来,实现客人点餐后直接送厨,订单也直接录入收银系统。 #点菜流程 ![image](https://raw.githubusercontent.com/flyfishzy/gicater-wechat-api/master/screenshots/table_service.jpg) ![image](https://raw.githubusercontent.com/flyfishzy/gicater-wechat-api/master/screenshots/take_away.jpg) #连接方式 客户端和服务器通过websocket保持长连接,当有新订单时服务器推送给收银客户端。 #下单接口 服务器接收到订单后,主动下发给客户端,使用json格式。 ###服务器发送 |Name|Required|Type|Description| |---|---|---|---| |command|true|string|sendorder| |serial|true|string|服务端订单号,客户端记录该订单号防止重复下单| |time|true|int|下单时间,UTC格式| |type|true|int|0-在桌点菜;1-外卖;2-预订| |chk_name|false|string|单名/整单备注| |table_id|true|int|桌号,外卖订单则为-1| |table_name|false|string|桌名,只用于显示| |amount|true|double|订单金额| |payment|true|int|1 –未支付,2-微信支付 3-会员余额 4-支付宝| |address|false|string|外卖地址| |phone|false|string|外卖电话| |cus_name|false|string|外卖客户姓名| |cus_num|false|int|客人数| |arrive_time|false|int|外卖的送货时间或者预订桌台的时间| |order_list|true|array|菜品列表| |id|true|int|菜品id| |name|false|string|菜品名称,自定义菜需要| |num|true|double|菜品数量| |pu|true|int|菜品的规格| |cdm|true|int|如果是调味品,则为所属菜品的id| |unit|false|string|规格名称,只用于显示| |req|false|string|附加要求| |pr|false|double|菜品单价| |ttl|false|double|小计。使用微信支付的模式下使用该字段,否则价格由客户端计算| **JSON样例** {"command":"sendorder","customer_num":2,"order_list":[{"id":7001,"num":1,"pu":1,"cdm":6001,"req":"不放辣"}],"table_id":1,"employee":"101"} ###返回结果 |Name|Type|Description| |---|---|---|---| |command|string|sendorder| |serial|int| |result|int|200,送厨成功| |||错误分为2类,可自动恢复的(>0)和不可恢复的:(小于0的错误需提示客户联系商家)| |||101,数据库连接错误| |||102,桌子正在操作| |||-1,找不到桌子| |||-2,有菜品沽清| #沽清菜品 客户端启动时发送沽清菜品列表给服务端。当重新设置了沽清时也上传给服务端。 ###客户端发送 |Name|Type|Description| |---|---|---| |command| string| soldouts| |type| int| 0- 全部, 1-仅更新修改的部分| |soldouts| 数组| 沽清菜品| | id| int| 菜品ID| | pu| int| 沽清的规格(-1或不存在则表示所有规格均沽清)| | num| int| 剩余份数|