🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
#### 列表 ~~~[api] get:/dealer/goods/index/index *number:storesId#门店ID string:search#搜索关键词 string:status=all#状态,all=>全部,onSale=>已上架,offSale=>已下架,saled=>已售完 number:cateId#分类ID number:brandsId#品牌ID number:p=1#当前页数 numbner:ps=20#分页大小 <<< success { "code": 1, "msg": "", "time": "2018-06-14 15:13:03", "data": [ { "id": 1, "dealer_id": 1, "stores_id": 1, "cate_id": 1, "brands_id": 0, "express_id": 0, "template_id": null, "sn": "20180614133808873510", "name": "商品1", "weight": 0, "volume": 0, "thumb": "http://oss.dgyouduo.com/static/img/no-image.png", "banner": [ "http://oss.dgyouduo.com/static/img/no-image-16x10.png" ], "summary": "商品摘要", "price": "10.00", "market_price": "20.00", "inventory": 100, "view_count": 0, "sale_count": 0, "sort": 0, "is_free_shipping": 0, "is_hot": 0, "is_new": 0, "is_real": 1, "is_sale": 1, "is_trash": 0, "status": 1, "created_at": "2016-01-01 00:00:00", "updated_at": "2018-06-14 14:56:32", "saled_at": "2016-01-01 00:00:00", "status_text": "正常" } ], "_meta": { "totalCount": 1, "pageCount": 1, "currentPage": 1, "perPage": 20 } } ~~~ #### 详情 ~~~[api] get:/dealer/goods/index/retrieve/id/:id <<< success { "code": 1, "msg": "", "time": "2018-06-14 14:57:19", "data": { "id": 1, "dealer_id": 1, "stores_id": 1, "cate_id": 1, "brands_id": 0, "express_id": 0, "template_id": null, "sn": "1234567890", "name": "商品1", "weight": 0, "volume": 0, "thumb": "http://oss.dgyouduo.com/static/img/no-image.png", "banner": [ "http://oss.dgyouduo.com/static/img/no-image-16x10.png" ], "summary": "商品摘要", "content": "商品内容", "price": "10.00", "market_price": "20.00", "inventory": 100, "view_count": 0, "sale_count": 0, "sort": 0, "is_free_shipping": 0, "is_hot": 0, "is_new": 0, "is_real": 1, "is_sale": 1, "status": 1, "created_at": "2016-01-01 00:00:00", "updated_at": "2018-06-14 14:56:32", "saled_at": "2016-01-01 00:00:00", "status_text": "正常", "cate_parent_id_path": "0_1" } } ~~~ #### 创建 ~~~[api] post:/dealer/goods/index/create *number:stores_id#门店ID *number:cate_id#分类ID number:brands_id#品牌ID number:express_id#快递ID string:sn=generateSn()#商品唯一编码 *string:name#名称 float:weight#重量(kg) float:volume#体积(m³) string:thumb=http://oss.dgyouduo.com/static/img/no-image.png#缩略图 string:banner#横幅(轮播图) string:summary#摘要 string:content#内容 *float:price#普通价格 *float:market_price#市场价格 *number:inventory#库存 number:sort=0#排序 number:is_free_shipping=0#是否包邮 number:is_real=1#是否实体商品 number:is_sale=0#是否上架 number:status=1#状态,0=>禁用,1=>启用 <<< success { "code": 1, "msg": "success", "time": "2018-01-03 21:04:36", "data": { "id": 1 } } ~~~ #### 更新 ~~~[api] post:/dealer/goods/index/update/id/:id number:cate_id#分类ID number:brands_id#品牌ID number:express_id#快递ID string:sn=generateSn()#商品唯一编码 string:name#名称 float:weight#重量(kg) float:volume#体积(m³) string:thumb=http://oss.dgyouduo.com/static/img/no-image.png#缩略图 string:banner#横幅(轮播图) string:summary#摘要 string:content#内容 float:price#普通价格 float:market_price#市场价格 number:inventory#库存 number:sort=0#排序 number:is_free_shipping=0#是否包邮 number:is_real=1#是否实体商品 number:is_sale=0#是否上架 number:status=1#状态,0=>禁用,1=>启用 <<< success { "code": 1, "msg": "success", "time": "2018-01-01 12:07:35", "data": [] } ~~~ #### 删除 ~~~[api] post:/dealer/goods/index/delete/id/:id <<< success { "code": 1, "msg": "success", "time": "2018-01-01 12:17:15", "data": [] } ~~~ #### 参数 > 商品参数根据分类变化,请先为商品选择分类,然后添加商品参数,最后再回来编辑参数。 ~~~[api] get:/dealer/goods/index/parameter/id/:id <<< success { "code": 1, "msg": "", "time": "2018-08-10 10:33:04", "data": [ { "id": 1, "dealer_id": 1, "stores_id": 1, "cate_id": 1, "name": "产地", "type": 1, "default_values": [ "" ], "sort": 0, "status": 1, "created_at": "2018-08-09 11:32:53", "updated_at": "2018-08-09 11:33:11", "parameter_value": null, "type_text": "单行文本", "status_text": "正常" } ], "_meta": { "totalCount": 1, "pageCount": 1, "currentPage": 1, "perPage": 20 } } ~~~ ~~~[api] post:/dealer/goods/index/parameter/id/:id *array:params#参数 *number:param_id#参数ID *mixed:value#值 <<< success { "code": 1, "msg": "success", "time": "2018-01-02 20:01:35", "data": [] } <<< example { "params": [ { "param_id": 1, "value": [1, 2, 3] } ] } ~~~ #### 规格 > 商品规格根据分类变化,请先为商品选择分类,然后添加商品规格,最后再回来编辑规格。 ~~~[api] get:/dealer/goods/index/sku/id/:id <<< success <<< error ~~~ ~~~[api] post:/dealer/goods/index/sku/id/:id *array:skus#规格 *string:sku_key#存放SKU库存量项目ID进行拼接 string:sn#商品唯一编码 string:thumb#缩略图 *float:price#普通价格 *float:marker_price#市场价格 *number:inventory#库存 number:sort=0#排序 number:status=1#状态,0=>禁用,1=>启用 <<< success { "code": 1, "msg": "success", "time": "2018-01-01 12:17:15", "data": [] } <<< example { "skus": [ { "sku_key": "5_9", "sn": "123456789", "thumb": "/img/no-image.png", "price": 100, "market_price": 105, "inventory": 10, "sort": 0, "status": 1 }, { "sku_key": "6_9", "price": 105, "market_price": 120, "inventory": 1 }, { "sku_key": "5_10", "price": 103, "market_price": 130, "inventory": 5 }, { "sku_key": "6_10", "price": 150, "market_price": 180, "inventory": 10 } ] } ~~~ #### 批量上架 ~~~[api] post:/dealer/goods/index/sales *array:ids#ID集合 <<< success { "code": 1, "msg": "success", "time": "2018-01-12 20:55:58", "data": [] } <<< example { "ids": [1, 2] } ~~~