前台-订单接口


订单接口

  1. 创建订单
  2. 订单List
  3. 订单详情detail
  4. 取消订单
  5. 获取订单中的商品信息(购物车中选中的商品)
  6. 直接创建订单

==1.创建订单==

HttpMethod: POST

Content-Type: application/x-www-form-urlencoded

Url: http://192.168.1.6:8080/player/order/v1/orderCreate

Request:

请求头:
Authorization:"token"
success
{
    "status": 0,
    "data": {
        "orderNo": 1485158223095,
        "payment": 2999.11,
        "paymentType": 1,
        "postage": 0,
        "status": 10,
        "paymentTime": null,
        "sendTime": null,
        "endTime": null,
        "closeTime": null,
        "createTime": 1485158223095,
        "orderItemVoList": [
            {
                "orderNo": 1485158223095,
                "productId": 2,
                "productName": "oppo R8",
                "productImage": "mainimage.jpg",
                "currentUnitPrice": 2999.11,
                "quantity": 1,
                "totalPrice": 2999.11,
                "createTime": null
            }
        ],
        "shippingId": 5,
        "shippingVo": null
    }
}
fail
{
    "status": 1,
    "msg": "创建订单失败"
}

==2.订单List==

HttpMethod: POST

Content-Type: application/x-www-form-urlencoded

Url: http://192.168.1.6:8080/player/order/v1/orderList

Request:

请求头:
Authorization:"token"
表单数据:
pageNum  = (可选)(默认1)
pageSize = (可选)(默认10)
specs = color:蓝色;size:16cm;
success
{
  "status": 0,
  "data": {
    "orderNo": 1493801531662,
    "payment": 11000,
    "paymentType": 1,
    "paymentTypeDesc": "在线支付",
    "postage": 0,
    "status": 10,
    "statusDesc": "未支付",
    "paymentTime": "",
    "sendTime": "",
    "endTime": "",
    "closeTime": "",
    "createTime": "",
    "orderItemVoList": [
      {
        "orderNo": 1493801531662,
        "productId": 2,
        "productName": "摄像头",
        "productImage": "jd_camera_20175301.jpg",
        "currentUnitPrice": 1000,
        "quantity": 11,
        "totalPrice": 11000,
        "createTime": ""
      }
    ],
    "imageHost": "http://192.168.1.6:8080/img/",
    "shippingId": 31,
    "receiverName": "geely",
    "shippingVo": {
      "receiverName": "geely",
      "receiverMobile": "18688888888",
      "receiverProvince": "北京",
      "receiverCity": "北京市",
      "receiverAddress": "中关村",
      "receiverZip": "100000"
    }
  },
  "success": true
}
fail
{
  "status": 10,
  "msg": "用户未登录,请登录"
}

==3.订单详情detail==

HttpMethod: POST

Content-Type: application/x-www-form-urlencoded

Url: http://192.168.1.6:8080/player/order/v1/orderDetail

Request:

请求头:
Authorization:"token"
表单数据:
orderNo= xx
success
{
  "status": 0,
  "data": {
    "orderNo": 1493801531662,
    "payment": 11000,
    "paymentType": 1,
    "paymentTypeDesc": "在线支付",
    "postage": 0,
    "status": 10,
    "statusDesc": "未支付",
    "paymentTime": "",
    "sendTime": "",
    "endTime": "",
    "closeTime": "",
    "createTime": "",
    "orderItemVoList": [
      {
        "orderNo": 1493801531662,
        "productId": 2,
        "productName": "摄像头",
        "productImage": "jd_camera_20175301.jpg",
        "currentUnitPrice": 1000,
        "quantity": 11,
        "totalPrice": 11000,
        "createTime": ""
      }
    ],
    "imageHost": "http://192.168.1.6:8080/img/",
    "shippingId": 31,
    "receiverName": "geely",
    "shippingVo": {
      "receiverName": "geely",
      "receiverMobile": "18688888888",
      "receiverProvince": "北京",
      "receiverCity": "北京市",
      "receiverAddress": "中关村",
      "receiverZip": "100000"
    }
  },
  "success": true
}
 statusDesc字段包含值:
      CANCELED(0,"已取消"),
        NO_PAY(10,"未支付"),
        PAID(20,"已付款"),
        SHIPPED(40,"已发货"),
        ORDER_SUCCESS(50,"订单完成"),
        ORDER_CLOSE(60,"订单关闭");
fail
{
  "status": 1,
  "msg": "没有找到订单"
}

==4.取消订单==

HttpMethod: POST

Content-Type: application/x-www-form-urlencoded

Url: http://192.168.1.6:8080/player/order/v1/orderCancel

Request:

请求头:
Authorization:"token"
表单数据:
orderNo= xx
success
{
  "status": 0
}
fail
{
  "status": 1,
  "msg": "该用户没有此订单"
}
{
  "status": 1,
  "msg": "此订单已付款,无法被取消"
}

==5.获取订单中的商品信息(购物车中选中的商品)==

HttpMethod: POST

Content-Type: application/x-www-form-urlencoded

Url: http://192.168.1.6:8080/player/order/v1/get_order_cart_product

Request:

请求头:
Authorization:"token"
success
{
    "status": 0,
    "data": {
        "orderItemVoList": [
            {
                "orderNo": null,
                "productId": 1,
                "productName": "iphone7",
                "productImage": "mmall/aa.jpg",
                "currentUnitPrice": 7999,
                "quantity": 10,
                "totalPrice": 79990,
                "createTime": ""
            }
        ],
        "imageHost": "http://img.happymmall.com/",
        "productTotalPrice": 79990
    }
}
fail
{
    "status": 1,
    "msg": "用户未登录"
}
{
  "status": 1,
  "msg": "购物车为空",
  "success": false
}

==6.直接创建订单==

HttpMethod: POST

Content-Type: application/x-www-form-urlencoded

Url: http://192.168.1.6:8080/player/order/v1/directly-create-order

Request:

请求头:
Authorization:"token"
表单数据:
productId= xx
count=xx
success
{
  "status": 0,
  "data": {
    "orderNo": 1494237867509,
    "payment": 336000,
    "paymentType": 1,
    "paymentTypeDesc": "在线支付",
    "postage": 0,
    "status": 10,
    "statusDesc": "未支付",
    "paymentTime": "",
    "sendTime": "",
    "endTime": "",
    "closeTime": "",
    "createTime": "",
    "orderItemVoList": [
      {
        "orderNo": 1494237867509,
        "productId": 1,
        "productName": "cup001-炫酷黑色",
        "productImage": "2017050201.jpg",
        "currentUnitPrice": 56000,
        "quantity": 6,
        "totalPrice": 336000,
        "createTime": "2017-05-08 18:04:27"
      }
    ],
    "imageHost": "http://192.168.1.6:8080/img/",
    "shippingId": 33,
    "receiverName": "蛮小满",
    "shippingVo": {
      "receiverName": "蛮小满",
      "receiverMobile": "100000000",
      "receiverProvince": "广东省",
      "receiverCity": "广州市",
      "receiverDistrict": "荔湾区",
      "receiverAddress": "游尾郡窝窝乡",
      "receiverZip": "",
      "default": false
    }
  },
  "success": true
}
fail
{
    "status": 1,
    "msg": "用户未登录"
}
{
  "status": 1,
  "msg": "购物车为空",
  "success": false
}

转载于:https://my.oschina.net/JoeyChou/blog/891481

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值