文档章节

前台-订单接口

 周颖
发布于 2017/05/03 17:15
字数 717
阅读 27
收藏 0

订单接口

  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
}

© 著作权归作者所有

粉丝 0
博文 6
码字总数 3406
作品 0
深圳
私信 提问
物流配送进程快递100查询接口

本插件使得您的网站可以从快递100接口获取相关配送公司的订单的具体进程,并在顾客登录网站时,查看订单详细信息时予以显示。 演示前台: http://coc020.chinaopencart.com 用户名: demo@de...

OpenCart中国
2015/05/27
0
0
Exrick/xmall-front

XMall-Front 基于Vue开发的XMall商城前台页面 项目已部署,在线Demo 前台商城:http://xmall.exrick.cn/ 后台管理系统:http://xmadmin.exrick.cn/ 感谢 yucccc 的开源 vue-mall 项目提供前端...

Exrick
2018/04/21
0
0
Yii 2.0开发一个仿京东商城平台

第1章 课程简介 介绍了课程内容、背景和案例展示。 第2章 项目的准备工作 介绍了如何使用PHP依赖管理工具Composer安装Yii2框架,模拟配置真实企业开发项目运行环境和编辑器。 第3章 项目前台...

15543595340
2018/05/19
0
0
Makingware 社区版 1.5.3 发布

Makingware 社区版 1.5.3 更新说明 改进: 后台邮件设置整合,将高级SMTP设置整合到系统统一的邮件设置中 后台商品列表增加前台对应页面链接,点击产品名称直接打开前台该产品对应页面 为高级...

虫虫
2011/07/18
1K
0
商城系统 DBShop V1.1 RC 20170714 发布

DBShop 电子商务网店系统,采用PHP官方框架 ZendFramework 2 开发而成。在网上建立自己的店铺、自己的销售网站的不二之选。强大的后台管理及简单的操作流程,让您一见倾心。严谨的功能结合、...

静静的风
2017/07/14
1K
1

没有更多内容

加载失败,请刷新页面

加载更多

读书replay《maven实战》.1.20190526

前情提要 maven这个工具用了好久了,但是一直都用的迷迷糊糊的,没有对它进行过系统性的学习,只是知道一些常用的功能怎么实现,所以20190516这一天我从JD购买了徐晓斌老师所著的《maven实战...

wanxiangming
29分钟前
0
0
真实项目案例实战——【状态设计模式】使用场景

什么是状态模式 状态模式允许一个对象在其内部状态改变的时候改变其行为。这个对象看上去就像是改变了它的类一样。 状态模式应用场景 1.一个对象的行为取决于它的状态,并且它必须在运行时刻根...

须臾之余
36分钟前
0
0
Java 实现把字符串转换成整数【底层实现】

https://blog.csdn.net/zl18310999566/article/details/80263396

qimh
39分钟前
0
0
IDEA的debugger

1、win下节省内存空间 3、条件断点

一只小青蛙
50分钟前
3
0
炸!亿级数据DB秒级平滑扩容

一步一步,娓娓道来。 一般来说,并发量大,吞吐量大的互联网分层架构是怎么样的? 数据库上层都有一个微服务,服务层记录“业务库”与“数据库实例配置”的映射关系,通过数据库连接池向数据...

编程SHA
56分钟前
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部