订单接口
- 创建订单
- 订单List
- 订单详情detail
- 取消订单
- 获取订单中的商品信息(购物车中选中的商品)
- 直接创建订单
==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
}