文档
测试

商品列表

GET
域名+ /index/goods/goods_list

接口描述

请求参数见下方注释

请求参数

参数名
类型
描述
必填
parentid
int
商品的分类parenid 即商品的二级分类id。 不传时,即所有的商品
必填
goodsname
string
搜索的商品名称
必填
goods_type
int
0:新品推荐 1热销产品
必填
order
int
排序字段名
必填
order_type
int
排序字段值
必填
page
int
当前页码
必填
pagenum
int
每页条数
必填
time
string
发起请求时间 第一次给 ‘’ 后面用返回的time
必填

响应参数

参数名
类型
描述
必填
code
int
示例:200
必填
count
int
示例:1
必填
data
array
数据列表
必填
id
int
示例:9
必填
goodsname
string
示例:test 商品名称
必填
goodsdesc
string
示例:test2 商品描述
必填
goodsprice
string
示例:1.00 商品价格
必填
off_price
string
示例:2.00 商品折扣价格 (划斜线)
必填
img
string
示例:20210730\30cb1708db58e4282036d5d739bca2ad.jpg
必填
goods_type
int
示例:0 0新品 1热销
必填
create_time
string
示例:2021-07-30 15:43:51
必填
sales
int
示例:0 销量
必填
likes
int
示例:0 点赞数
必填
time
int
示例:1628227778 第一页请求时间值给空 time=‘’,请求数据成功后赋值 : 第二、三...页 time=res.time
必填

说明 / 示例

一:两级分类下的商品列表 只需要传parentid:所属商品分类 goodsname:搜索商品的名称即可 二:首页更多商品如下传递参数如下: 从首页新品推荐-更多进来将goods_type:0带入到列表页中 从首页热销产品-更多进来将goods_type:1带入到列表页中 1排序 传入两个字段:order排序字段名 、order_type排序字段值 全部:order:'time'、 order_type :0, 综合:order:'mix'、 order_type :0, 销量由高到低:order:'sales' 、order_type:0 价格由高到低:order:goodsprice 、order_type:0 价格由低到高:order:goodsprice 、order_type:1 2搜索商品名称 goodsname:'xxx'