美文网首页工作生活
订餐小程序接口

订餐小程序接口

作者: zmindthegap | 来源:发表于2019-07-01 15:58 被阅读0次

    默认请求头信息

    Token:QVSu5SRmZ9DDbh06K1hn1UCCJsYslEBp6NJMt05W9u60yOR8GS4NMgcKK4LWvLGJ
    Auth:334 //user表ID
    Pre:YCU //用户端固定YCU 商户端YCM

    小程序用户端


    清理redis数据缓存

    【GET】{{dingcan}}/api/cleanRedis

    首页

    {{dingcan}}/api/index
    【GET】

    {
        "code": 0,
        "msg": "请求成功",
        "data": {
            "sys_conf": {
                "id": 1,
                "title": "****自助点餐",
                "phone": "13586710142",
                "phone2": "0574-56155555",
                "logo": "images/2019-04-06/D1DAF111-B271-4468-93DF-7F8FA221767A1554535604.jpg",
                "start_time": "17:30",
                "end_time": "22:30"
            },
            "banner": [
                {
                    "id": 4,
                    "title": "轮播图",
                    "intro": null,
                    "start_time": 1553184000,
                    "end_time": 1987484800,
                    "banner_flag": "MINI_HOME",
                    "photo": "sys/2019-06-22/20190622_5d0dbde1a1459P6M.jpg",
                    "url_type": "HTTP",
                    "url": null,
                    "status": 1,
                    "sort": 0,
                    "c_time": 1553236695,
                    "u_time": 1558593051,
                    "del": 0
                },
                {
                    "id": 5,
                    "title": "轮播图1",
                    "intro": null,
                    "start_time": 1553184000,
                    "end_time": 1987484800,
                    "banner_flag": "MINI_HOME",
                    "photo": "sys/2019-06-22/20190622_5d0db8e0c5a7cYKU.jpg",
                    "url_type": "HTTP",
                    "url": null,
                    "status": 1,
                    "sort": 0,
                    "c_time": 1553236785,
                    "u_time": 1653571082,
                    "del": 0
                },
                {
                    "id": 6,
                    "title": "轮播图2",
                    "intro": null,
                    "start_time": 1553184000,
                    "end_time": 1687484800,
                    "banner_flag": "MINI_HOME",
                    "photo": "sys/2019-06-22/20190622_5d0dbded58d7exo4.jpg",
                    "url_type": "HTTP",
                    "url": null,
                    "status": 1,
                    "sort": 0,
                    "c_time": 1553237237,
                    "u_time": 1553391083,
                    "del": 0
                },
                {
                    "id": 7,
                    "title": "轮播图3",
                    "intro": null,
                    "start_time": 1553184000,
                    "end_time": 1687484800,
                    "banner_flag": "MINI_HOME",
                    "photo": "sys/2019-05-08/20190508_5cd28107052e3j8p.jpg",
                    "url_type": "HTTP",
                    "url": null,
                    "status": 1,
                    "sort": 0,
                    "c_time": 1553239132,
                    "u_time": 1557299467,
                    "del": 0
                }
            ],
            "recomm_goods": [
                {
                    "id": 123,
                    "mch_id": 143,
                    "title": "鲜榨西瓜汁",
                    "title_en": null,
                    "status": 1,
                    "photo": "sys/2019-07-02/20190702_5d1afbfd86ee2bVt.jpg",
                    "sell_status": 1,
                    "market_price": 2500,
                    "price": 2000,
                    "stock": 999,
                    "sort": 0,
                    "price_extend_status": 0,
                    "tags_extend_status": 0,
                    "intro": "",
                    "c_time": 1562049544,
                    "u_time": 1562049544,
                    "del": 0,
                    "cate_id": "66"
                },
                {
                    "id": 127,
                    "mch_id": 144,
                    "title": "意大利番茄旋风薯塔",
                    "title_en": null,
                    "status": 1,
                    "photo": "sys/2019-07-02/20190702_5d1afcae2ab4aAz8.jpg",
                    "sell_status": 1,
                    "market_price": 3000,
                    "price": 2500,
                    "stock": 999,
                    "sort": 0,
                    "price_extend_status": 0,
                    "tags_extend_status": 1,
                    "intro": "",
                    "c_time": 1562049722,
                    "u_time": 1562049722,
                    "del": 0,
                    "cate_id": "67"
                }
            ],
            "goods_cate": [
                {
                    "id": 54,
                    "title": "烧烤",
                    "photo": "sys/2019-07-02/20190702_5d1b0649e6fc3JlJ.jpg"
                },
                {
                    "id": 55,
                    "title": "啤酒",
                    "photo": "sys/2019-07-02/20190702_5d1b062cd540eNmK.jpg"
                },
                {
                    "id": 56,
                    "title": "饮料",
                    "photo": "sys/2019-07-02/20190702_5d1b0623bc3e3Krk.jpg"
                },
                {
                    "id": 57,
                    "title": "小吃",
                    "photo": "sys/2019-07-02/20190702_5d1b0615d8e74Uyr.jpg"
                },
                {
                    "id": 58,
                    "title": "凉菜",
                    "photo": "sys/2019-07-02/20190702_5d1b068fd240f8fK.jpg"
                },
                {
                    "id": 60,
                    "title": "炒面",
                    "photo": "sys/2019-07-02/20190702_5d1b05b211c816MJ.jpg"
                },
                {
                    "id": 62,
                    "title": "铁板烧",
                    "photo": "sys/2019-07-02/20190702_5d1b05962cc143bA.jpg"
                },
                {
                    "id": 63,
                    "title": "串串",
                    "photo": "sys/2019-07-02/20190702_5d1b058a0ef01PuA.jpg"
                },
                {
                    "id": 64,
                    "title": "冰淇淋",
                    "photo": "sys/2019-07-02/20190702_5d1b057a21fb0Arr.jpg"
                },
                {
                    "id": 65,
                    "title": "水果果切",
                    "photo": "sys/2019-07-02/20190702_5d1b056e23950rNA.jpg"
                },
                {
                    "id": 66,
                    "title": "果汁类",
                    "photo": "sys/2019-07-02/20190702_5d1b0563e6eddghR.jpg"
                },
                {
                    "id": 67,
                    "title": "薯塔",
                    "photo": "sys/2019-07-02/20190702_5d1b0536521164yG.jpg"
                },
                {
                    "id": 68,
                    "title": "小龙虾",
                    "photo": "sys/2019-07-02/20190702_5d1b0547e9dd8w2a.jpg"
                }
            ]
        }
    }
    

    获取美食菜单

    {{dingcan}}/api/goodsData
    【GET】
    由于数据太多【不展示】

    生成订单

    {{dingcan}}/api/generateOrder
    【POST】

    请求参数【示例】

      {
        "desk_id": "8",
        "desk_no": "鲸夜8号桌",
        "channel_id": "1",
        "note": "",
        "realname": "占*胜",
        "mobile": "136****7958",
        "data": [
            {
                "id": "47",
                "price_id": "0",
                "tags": [
                    {
                    }
                ],
                "num": "1"
            },
            {
                "id": "50",
                "price_id": "0",
                "tags": [
                    {
                    }
                ],
                "num": "20"
            }
        ]
    }
    

    返回示例

    {
        "code": 0,
        "msg": "请求成功",
        "data": {
            "order_no": "201907031048476602664",
            "order_id": 429,
            "mobile": "136****7958",
            "c_time": 1562122127,
            "pay_exprire_time": 1562123027
        }
    }
    

    wx支付接口

    {{diancan}}/api/payFee
    【POST】
    参数【示例】
    { "openid":"oCSoC5aHk-XbF_nqRAeTDWRf7I64", "order_id":"429" }
    返回【示例】

    {
        "code": 0,
        "msg": "请求成功",
        "data": {
            "appId": "wx2f68235778653f53",
            "timeStamp": "1562122647",
            "nonceStr": "olyw1leye2yx0iwlj6vg26i02tuvm47x",
            "package": "prepay_id=wx03105724630535f03fbb6f1e1798417800",
            "signType": "MD5",
            "paySign": "CA777021FCFEC0841F4E2914A7F6741C"
        }
    }
    

    获取所有订单

    {{dingcan}}/api/getOrders
    【POST】
    默认请求头

    返回:

    {
        "code": 0,
        "msg": "请求成功",
        "data": [
            {
                "id": 372,
                "order_no": "201907011533389041714",
                "transaction_no": "2019070122001441540529745133",
                "goods_num": 1,
                "order_title": "烤鱿鱼",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 7200,
                "pay_fee": 7200,
                "pay_exprire_time": 1561967318,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561966424,
                "qrcode": "95bf1061056befd93efcf9871482099f",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 1,
                "c_time": 1561966418,
                "u_time": 1561966418,
                "del": 0
            },
            {
                "id": 371,
                "order_no": "201907011527365019516",
                "transaction_no": "2019070122001441540531704164",
                "goods_num": 1,
                "order_title": "大肉串",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 9000,
                "pay_fee": 9000,
                "pay_exprire_time": 1561966956,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561966062,
                "qrcode": "8c292a7aff86e6a7602fe3ebcc00c941",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 1,
                "c_time": 1561966056,
                "u_time": 1561966056,
                "del": 0
            },
            {
                "id": 370,
                "order_no": "201907011524365518200",
                "transaction_no": null,
                "goods_num": 1,
                "order_title": "农夫山泉",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 1000,
                "pay_fee": 1000,
                "pay_exprire_time": 1561966776,
                "order_status": 1,
                "payment_flag": null,
                "pay_status": 0,
                "pay_time": 0,
                "qrcode": "4103ef209e38651acc0273ec04331ad8",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561965876,
                "u_time": 1561965876,
                "del": 0
            },
            {
                "id": 369,
                "order_no": "201907011524365518201",
                "transaction_no": null,
                "goods_num": 1,
                "order_title": "红牛",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 600,
                "pay_fee": 600,
                "pay_exprire_time": 1561965780,
                "order_status": 1,
                "payment_flag": null,
                "pay_status": 0,
                "pay_time": 0,
                "qrcode": "429f11b6aee5b17a704ebae26e8ff356",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561964880,
                "u_time": 1561964880,
                "del": 0
            },
            {
                "id": 368,
                "order_no": "201907011451506163706",
                "transaction_no": null,
                "goods_num": 1,
                "order_title": "红牛",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 600,
                "pay_fee": 600,
                "pay_exprire_time": 1561964810,
                "order_status": 1,
                "payment_flag": null,
                "pay_status": 0,
                "pay_time": 0,
                "qrcode": "10c8c6d008686388cd68f7e9b9f1974d",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561963910,
                "u_time": 1561963910,
                "del": 0
            },
            {
                "id": 367,
                "order_no": "201907011438196853873",
                "transaction_no": null,
                "goods_num": 1,
                "order_title": "红牛",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 600,
                "pay_fee": 600,
                "pay_exprire_time": 1561963999,
                "order_status": 1,
                "payment_flag": null,
                "pay_status": 0,
                "pay_time": 0,
                "qrcode": "6fb12014ae68c54a6fcad57c90d09247",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561963099,
                "u_time": 1561963099,
                "del": 0
            },
            {
                "id": 366,
                "order_no": "201907011424232866750",
                "transaction_no": "2019070122001441540530026218",
                "goods_num": 1,
                "order_title": "红牛",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 600,
                "pay_fee": 600,
                "pay_exprire_time": 1561963163,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561962275,
                "qrcode": "1484b757893eeff8ff87d1566f6937e1",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561962263,
                "u_time": 1561962263,
                "del": 0
            },
            {
                "id": 365,
                "order_no": "201907011423423916754",
                "transaction_no": "2019070122001441540529728923",
                "goods_num": 1,
                "order_title": "红牛",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 600,
                "pay_fee": 600,
                "pay_exprire_time": 1561963122,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561962231,
                "qrcode": "f7fa48fd6561a9947d81c9acab890f3b",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561962222,
                "u_time": 1561962222,
                "del": 0
            },
            {
                "id": 364,
                "order_no": "201907011421479919619",
                "transaction_no": "2019070122001441540530776880",
                "goods_num": 15,
                "order_title": "农夫山泉+大肉串+冰红茶+红牛+农夫...",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 21900,
                "pay_fee": 21900,
                "pay_exprire_time": 1561963007,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561962117,
                "qrcode": "673eb55387dbfe2ed09a9b5a8e66a9d9",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561962107,
                "u_time": 1561962107,
                "del": 0
            },
            {
                "id": 362,
                "order_no": "201907011415076738206",
                "transaction_no": "2019070122001441540530195731",
                "goods_num": 4,
                "order_title": "农夫山泉+大肉串+冰红茶+红牛",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 10900,
                "pay_fee": 10900,
                "pay_exprire_time": 1561962607,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561961718,
                "qrcode": "cea4c785d18a8ac60d62599b77edcd4b",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 0,
                "c_time": 1561961707,
                "u_time": 1561961707,
                "del": 0
            }
        ],
        "totalNumber": 2
    }
    

    获取订单详情

    {{dingcan}}/api/getOrderDetails?order_id=372
    【GET】
    默认请求头

    返回:

    {
        "code": 0,
        "msg": "请求成功",
        "data": {
            "order_details": {
                "id": 372,
                "order_no": "201907011533389041714",
                "transaction_no": "2019070122001441540529745133",
                "goods_num": 1,
                "order_title": "烤鱿鱼",
                "user_id": 334,
                "desk_id": 1,
                "desk_no": "1号桌",
                "total_fee": 7200,
                "pay_fee": 7200,
                "pay_exprire_time": 1561967318,
                "order_status": 2,
                "payment_flag": "ALIPAY",
                "pay_status": 1,
                "pay_time": 1561966424,
                "qrcode": "95bf1061056befd93efcf9871482099f",
                "channel_id": 1,
                "mobile": "13777777777",
                "realname": "陈奕迅",
                "note": "",
                "valid_status": 1,
                "c_time": 1561966418,
                "u_time": 1561966418,
                "del": 0
            },
            "order_goods": {
                "新疆爱波来羊肉串": {
                    "order_goods": [
                        {
                            "id": 763,
                            "mch_id": 130,
                            "order_id": 372,
                            "order_no": "201907011533389041714",
                            "user_id": 334,
                            "desk_id": 1,
                            "desk_no": "1号桌",
                            "price_id": 98,
                            "price_title": "5串",
                            "payment_flag": "ALIPAY",
                            "pay_status": 1,
                            "pay_time": 1561966424,
                            "order_status": 2,
                            "qrcode": "95bf1061056befd93efcf9871482099f",
                            "channel_id": 1,
                            "mobile": "13777777777",
                            "realname": "陈奕迅",
                            "goods_id": 26,
                            "goods_num": 1,
                            "goods_photo": "sys/2019-06-28/20190628_5d1565fe3993av6D.jpg",
                            "goods_price": 7200,
                            "goods_total_fee": 7200,
                            "goods_title": "烤鱿鱼",
                            "goods_tags": "5串/麻辣",
                            "refund_status": 0,
                            "refund_time": null,
                            "refund_num": 0,
                            "note": "",
                            "c_date": "2019-07-01",
                            "settlement_status": 0,
                            "c_time": 1561966418,
                            "u_time": 1561966418,
                            "del": 0
                        }
                    ],
                    "order_status": 2
                }
            }
        }
    }
    

    取消订单

    {{dingcan}}/removeOrder
    【PUT】
    参数
    {"order_id":"429"}
    返回【示例】

    {
        "code": 0,
        "msg": "请求成功",
        "data": null
    }
    

    安卓用户商户端


    获取商户新订单(10s被调用一次)按时间asc,顶最早订单

    {{dingcan}}/newOrder
    【GET】
    参数

    返回【示例】

    当无新订单时返回

    {
        "code": 0,
        "msg": "请求成功",
        "data": null
    }
    

    操作订单(拒单,接单)

    {{dingcan}}/replyOrder
    【PUT】
    参数
    order_id 订单id
    status 操作指令编号
    指令编号 1:接单,2:拒单,3:送餐(完成)
    返回【示例】

    {
        "code": 0,
        "msg": "请求成功",
        "data": null
    }
    

    获取今日所有订单

    {{dingcan}}/getMchOrders
    【POST】
    参数
    order_status 订单状态 null 默认全部(包含已退款,拒单)
    page 当前页 默认 1
    pageSize 每页显示条数默认 10

    按时间区间搜索全部订单

    {{dingcan}}/getTimeAllOrder
    【POST】
    参数
    start_time 开始时间(传递一个开始时间,默认搜开始时间当天)
    end_time 结束时间
    refund_status 是否有效(退款)null: 所有 ,1:无效,: 有效

    订单详情

    {{dingcan}}/getDetails
    【GET】
    参数
    order_id 订单ID

    数据统计

    {{dingcan}}/getStatisticsData
    【POST】
    参数
    start_time 开始时间(传递一个开始时间,默认搜开始时间当天)
    end_time 结束时间
    data_type 收入占比统计方式 ,channel: 渠道 ,product:产品

    相关文章

      网友评论

        本文标题:订餐小程序接口

        本文链接:https://www.haomeiwen.com/subject/cragcctx.html