−目录

手机接口

开发进度

一期

二期

数据格式约定

返回数据为json格式,code为200表示数据正常,datas为返回的数据

{code: 200, datas: {}}

返回值

获取数据

//有内容直接返回数组,无内容返回空数组[]
//hasmore为是否有下一页
{"code":200,"hasmore":true,"datas":{"goods_list":[]}}

操作成功

//操作成返回"1"
{"code":200,"datas":{"1"}}

错误

//出现错误返回error,error内为错误信息
{"code":200,"datas":{"error":"参数错误"}}
//登陆失败,login:0
{"code":200,"login":"0","datas":{"error":"\u8bf7\u767b\u9646"}}

API

首页

首页数据接口(get)

  index.php?act=index

商品分类

一级分类接口(get)

  index.php?act=goods_class

指定分类接口(get)

有下级分类返回分类列表,无分类返回'0'

  index.php?act=goods_class&gc_id=2

商品列表

商品列表接口(get)

  index.php?act=goods&op=goods_list

请求参数

  key 排序方式 1-销量 2-浏览量 3-价格 空-按最新发布排序
  order 排序方式 1-升序 2-降序
  page 每页数量
  curpage 当前页码
  gc_id 分类编号
  keyword 搜索关键字
  gc_id和keyword二选一不能同时出现

返回数据

  goods_id  商品编号
  goods_name  商品名称
  goods_price 商品价格 
  goods_marketprice 商品市场价
  goods_salenum 销量 
  evaluation_good_star 评价星级
  evaluation_count 评价数
  group_flag 是否团购
  xianshi_flag 是否限时折扣
  goods_image 图片名称
  goods_image_url 图片地址

商品详细信息

商品详细信息接口(get)

  index.php?act=goods&op=goods_detail

请求参数

  goods_id 商品编号

返回数据

goods_info 商品信息
  goods_name 商品名称
  goods_jingle 商品说明
  spec_name 规格名称
  spec_value 规格名
  goods_price 商品价格
  goods_marketprice 商品市场价
  goods_id 商品编号
  goods_click 商品点击数
  goods_commentnum 商品评论数
  goods_salenum 商品销量
  goods_spec 商品规格
  goods_storage 商品库存
  evaluation_good_star 评价等级
  evaluation_count 评价数
  promotion_type 促销类型 groupbuy-团购 xianshi-限时折扣
  promotion_price 促销价格
  upper_limit 最多购买数
spec_list 规格列表
spec_image 规格图片
goods_image 商品图片
goods_commend_list 推荐商品列表
mansong_info 满即送信息
  mansong_name 活动名称
  start_time 开始时间
  end_time 结束时间
  price 活动金额
  discount 减现金
  mansong_goods_name 赠送商品名称
  goods_id 赠送商品编号
  goods_image_url 赠送商品图片地址

商品介绍信息

调用接口(get)

  index.php?act=goods&op=goods_body

请求参数

  goods_id 商品编号

返回数据

  html

登陆

登陆接口(post)

  index.php?act=login

请求参数

  username 用户名
  password 密码 
  client 客户端类型(android wap ios wechat)

返回数据

  username 用户名
  key 登陆令牌

注册

注册接口(post)

  index.php?act=login&op=register

请求参数

返回数据

注销

注销接口(post)

  index.php?act=logout

请求参数

  username 用户名
  key 当前登陆令牌
  client 客户端类型(android wap ios wechat)

返回数据

  '1'

我的商城

调用接口(post)

  index.php?act=member_index

请求参数

  key 当前登陆令牌

返回数据

  username 用户名
  avator 用户头像
  point 积分
  predepoit 预存款

收藏列表

调用接口(post)

  index.php?act=member_favorites&op=favorites_list

请求参数

  key 当前登陆令牌

返回数据

  goods_name 商品名称
  goods_image_url 商品图片地址
  goods_price 商品价格
  fav_id 收藏编号

收藏添加

调用接口(post)

  index.php?act=member_favorites&op=favorites_add

请求参数

  goods_id 商品编号
  key 当前登陆令牌

返回数据

  '1'

收藏删除

调用接口(post)

  index.php?act=member_favorites&op=favorites_del

请求参数

  fav_id 收藏编号
  key 当前登陆令牌

返回数据

  '1'

地址列表

调用接口(post)

  index.php?act=member_address&op=address_list

请求参数

  key 当前登陆令牌

返回数据

address_list

  city_id 城市编号
  area_id 地区编号
  area_info 地址
  address 详细地址
  tel_phone 固定电话机
  mob_phone 手机

地址详细信息

调用接口(post)

  index.php?act=member_address&op=address_info

请求参数

  key 当前登陆令牌
  address_id 地址编号

返回数据

  area_info 地址
  address 详细地址
  tel_phone 固定电话机
  mob_phone 手机

地址删除

调用接口(post)

  index.php?act=member_address&op=address_del

请求参数

  key 当前登陆令牌
  address_id 地址编号

返回数据

  '1'

地址添加

调用接口(post)

  index.php?act=member_address&op=address_add

请求参数

  key 当前登陆令牌
  true_name 姓名
  city_id 城市编号(地址联动的第二级)
  area_id 地区编号(地址联动的第三级)
  area_info 地区信息,例:天津 天津市 红桥区
  address 地址信息,例:水游城8层
  tel_phone 电话号码
  mob_phone 手机

返回数据

  address_id

地址编辑

调用接口(post)

  index.php?act=member_address&op=address_edit

请求参数

  key 当前登陆令牌
  address_id 地址编号
  true_name 姓名
  area_id 地区编号
  city_id 城市编号
  area_info 地区信息,例:天津 天津市 红桥区
  address 地址信息,例:水游城8层
  tel_phone 电话号码
  mob_phone 手机

返回数据

  '1'

地区列表

调用接口(post)

  index.php?act=member_address&op=area_list

请求参数

  key 当前登陆令牌
  area_id 地区编号(为空时默认返回一级分类)

返回数据

  area_id 地区编号
  area_name 地区名称

订单列表

调用接口(post)

  index.php?act=member_order&op=order_list

请求参数

  key 当前登陆令牌

返回数据

订单状态

  0-已取消
  10-未支付
  20-已支付
  30-已发货
  40-交易成功

订单取消(未付款)

调用接口(post)

  index.php?act=member_order&op=order_cancel

请求参数

  key 当前登陆令牌
  order_id 订单编号

返回数据

  '1'

订单确认收货

调用接口(post)

  index.php?act=member_order&op=order_receive

请求参数

  key 当前登陆令牌
  order_id 订单编号

返回数据

  '1'

购物车列表

调用接口(post)

  index.php?act=member_cart&op=cart_list

请求参数

  key 当前登陆令牌

返回数据

cart_list

  
  cart_id 购物车编号
  buyer_id 买家member_id 
  store_id 店铺编号 
  store_name 店铺名称
  goods_id 商品编号
  goods_name 商品名称
  goods_price 商品价格
  goods_num 购买数量
  goods_image_url 图片地址
  goods_sum 商品总价
  

sum 购物车总价

购物车添加

调用接口(post)

  index.php?act=member_cart&op=cart_add

请求参数

  key 当前登陆令牌
  goods_id 商品编号
  quantity 购买数量

返回数据

  '1'

购物车删除

调用接口(post)

  index.php?act=member_cart&op=cart_del

请求参数

  key 当前登陆令牌
  cart_id 购物车编号

返回数据

  '1'
  

购物车修改数量

调用接口(post)

  index.php?act=member_cart&op=cart_edit_quantity

请求参数

  key 当前登陆令牌
  cart_id 购物车编号
  quantity 新的购买数量

返回数据

  quantity 购买数量
  goods_price 商品价格
  total_price 商品总价

发票列表

调用接口(post)

  index.php?act=member_invoice&op=invoice_list

请求参数

  key 当前登陆令牌

返回数据

invoice_list

发票添加

调用接口(post)

  index.php?act=member_invoice&op=invoice_add

请求参数

  key 当前登陆令牌
  inv_title_select 发票类型,可选值:person(个人) company(单位)
  inv_title 发票抬头(inv_title_select为company时需要提交)
  inv_content 发票内容,可通过invoice_content_list接口获取可选值列表

返回数据

  inv_id 发票编号 

发票删除

调用接口(post)

  index.php?act=member_invoice&op=invoice_del

请求参数

  key 当前登陆令牌
  inv_id 发票编号

返回数据

'1'

发票内容列表

调用接口(post)

  index.php?act=member_invoice&op=invoice_content_list

请求参数

  key 当前登陆令牌

返回数据

invoice_content_list

购买第一步

调用接口(post)

  index.php?act=member_buy&op=buy_step1

请求参数

key

当前登陆令牌

cart_id

立即购买: 第一个数字为商品编号,第二个数字为购买数量,用竖线分割。例:232|1
购物车购买:第一个数字为购物车编号,第二个数字为购买数量,用竖线分割。多组用半角逗号分割,例:232|1,110|2 232商品购买1个,110商品购买2个

ifcart

购物车购买标志 1

返回数据

ifcart 购物车购买标志 1

store_cart_list

购物车列表 店铺编号为下标的数组
  * goods_list 商品列表
    * goods_num 购买数量
    * goods_id 商品编号
    * goods_commonid 商品通用编号
    * store_id 店铺编号
    * goods_name 商品名称
    * goods_price 商品价格
    * goods_image_url 商品图片
    * transport_id 运费模板编号
    * goods_freight 运费
    * goods_storage 库存
    * state 商品是否有效 true
    * storage_state 
    * cart_id 购物车编号
    * bl_id 组合销售编号
    * promotions_id
    * ifxianshi
    * premiums 赠品标志 true
    * goods_total 总价
  * store_goods_total 店铺商品总价 店铺编号为下标的数组
  * store_mansong_rule_list 满送规则列表 店铺编号为下标的数组
  * store_vouche_list  店铺代金券列表 数组下标是voucher_t_id
  * freight 0-免运费 1-需要计算运费
  * freight_message 免运费时的说明
  * store_name 店铺名称

freight_hash

运费hash,选择地区时作为参数提交

address_info

收货地址信息

ifshow_offpay

支持货到付款时为true

vat_hash

发票信息hash

inv_info

发票信息

available_predeposit

可用预存款

更换收货地址

调用接口(post)

  index.php?act=member_buy&op=change_address

请求参数

  key 当前登陆令牌
  freight_hash 运费hash,第一步返回结果里有直接提交
  city_id 城市编号
  area_id 地区编号

返回数据

  content 运费列表,以店铺编号为下标数组,值为运费
  allow_offpay 是否允许货到付款 1-允许 0-不允许
  offpay_hash 货到付款hash

验证密码

调用接口(post)

  index.php?act=member_buy&op=check_password

请求参数

  key 当前登陆令牌
  password 用户密码

返回数据

'1'

购买第二步

调用接口(post)

  index.php?act=member_buy&op=buy_step2

请求参数

key

当前登陆令牌

ifcart

购物车购买标志 1 

cart_id

立即购买: 第一个数字为商品编号,第二个数字为购买数量,用竖线分割。例:232|1
购物车购买:第一个数字为购物车编号,第二个数字为购买数量,用竖线分割。多组用半角逗号分割,例:232|1,110|2 232商品购买1个,110商品购买2个

address_id

收货地址编号

vat_hash

发票信息hash,第一步接口提供

offpay_hash

是否支持货到付款hash,通过更换收货地址接口获得

pay_name

付款方式,可选值 online(线下付款) offline(货到付款)

invoice_id

发票信息编号

voucher

以店铺编号为下标的数组,内容以竖线分割 voucher_t_id|store_id|voucher_price 例:10|2|10

pd_pay

是否使用预存款支付 1-使用 0-不使用

password

用户密码,启动预存款支付时需要提交

返回数据

pay_sn

支付

调用接口(get)

  index.php?act=member_payment&op=pay

请求参数