#### 接口版本: |版本号|制定人|修订日期|说明| |:----|:----|:---- |:----| |1.0 |Karen |2021-10-26 |建立文档| #### 请求URL: - {{HOST}}/api/product/show #### 请求方式: - POST #### 请求头: |参数名|是否必须|类型|说明| |:---- |:---|:----- |----- | |Content-Type |是 |string |application/json | |Accept |是 |string |application/json | |Authorization|否|string|Bearer {token},`登录`接口获取| |uuid |否 |string |uuid,每个接口都会通过 headers 头返回 | |locale |否 |string |语言,默认 en,更多配置查看文件 `/config/strongshop.php` 中 `langs`| |currency |否 |string |货币,默认 USD,更多配置查看文件 `/config/strongshop.php` 中 `currencies`| #### 请求参数: |参数名|是否必须|类型|说明| |:---- |:---|:----- |----- | |id|是|integer|产品id| #### 返回示例: **正确时返回:** ``` { "code": 200, "message": "Success", "data": { "id": 2,//产品id "title": "Womens Mini Dress Batwing Boat Neck Long Sleeve Tunic Shift Dress Red-S",//产品名称 "intro": "",//产品简介 "details": null,//产品详情 "meta_keywords": "", "meta_description": "", "spu": "dress100", "sku": "dress100-02-s", "stock": 55,//库存 "stock_status": 1, "original_price": "55.000",//市场价格 "sale_price": "45.000",//售价 //批发信息 "wholesale_set": { "num": [], "price": [] }, //产品封面图 "img_cover": "http://demo.strongshop.local/storage/202103/LgLF3A9bJ8SJq0gqhrtHTrJKf7EieaxPmxulQsLF_thumb.jpg", //产品规格图 "img_spec": "http://demo.strongshop.local/storage/202103/LgLF3A9bJ8SJq0gqhrtHTrJKf7EieaxPmxulQsLF_thumb.jpg", "long": 0, "width": 0, "high": 0, "weight": 630, "volume_weight": 0, "click_num": 344, "sale_num": 0, "status": 1, "hidden": 2, "remark": "", "related_sku": "", "related_accessories_sku": null, "brand_id": 0, "spec_group_id": 1, "is_hot": 1, "is_new": 1, "is_recommend": 1, "more": null, "is_collected": 0,//是否已收藏 //产品相册图 "asset_img_photos": [ { "src": "http://demo.strongshop.local/storage/202103/LgLF3A9bJ8SJq0gqhrtHTrJKf7EieaxPmxulQsLF.jpg", "title": "s-l1600 (4).jpg", "src_thumb": "http://demo.strongshop.local/storage/202103/LgLF3A9bJ8SJq0gqhrtHTrJKf7EieaxPmxulQsLF_thumb.jpg" }, { "src": "http://demo.strongshop.local/storage/202103/kcxiKFnPGFpkiINNP1xpAtfCiOk1Vfvr4GGg9KJO.jpg", "title": "s-l1600 (5).jpg", "src_thumb": "http://demo.strongshop.local/storage/202103/kcxiKFnPGFpkiINNP1xpAtfCiOk1Vfvr4GGg9KJO_thumb.jpg" } ], "spu_specs": [ { "product_id": 1, "sku": "dress100-01-s", "spec_values": [ "1", "Black", "S" ] }, { "product_id": 2, "sku": "dress100-02-s", "spec_values": [ "Red", "S" ] }, { "product_id": 3, "sku": "dress100-01-m", "spec_values": [ "Black", "M" ] }, { "product_id": 4, "sku": "dress100-02-m", "spec_values": [] }, { "product_id": 5, "sku": "dress100-03-s", "spec_values": [ "Cappuccino", "S" ] }, { "product_id": 6, "sku": "dress100-03-m", "spec_values": [ "Cappuccino", "M" ] }, { "product_id": 7, "sku": "dress100-03-l", "spec_values": [ "Cappuccino", "L" ] }, { "product_id": 8, "sku": "dress100-04-s", "spec_values": [] }, { "product_id": 9, "sku": "dress100-04-xxl", "spec_values": [] } ], "specs": [ { "id": 1, "name": "颜色", "is_show_img": 1, "select_values": "Black\nGraphite\nAshen\nRed\nCappuccino\nBlue\nCrimson\nBeige\nKhaki\nViolet\nWhite\nPurple", "spu_specs": [ { "id": 1, "name": "颜色", "product_img": "http://demo.strongshop.local/storage/202103/XWeecxlCNoas5htxv6c68OzJjYwMfRZ1tQ8JoJgJ_thumb.jpg", "pivot": { "product_id": 3, "spec_id": 1, "spec_value": "Black" } }, { "id": 1, "name": "颜色", "product_img": "http://demo.strongshop.local/storage/202103/LgLF3A9bJ8SJq0gqhrtHTrJKf7EieaxPmxulQsLF_thumb.jpg", "pivot": { "product_id": 2, "spec_id": 1, "spec_value": "Red" } }, { "id": 1, "name": "颜色", "product_img": "http://demo.strongshop.local/storage/202103/r1g3ARlVM5bXGdSOJfnaweRNTkbWStb7dAtnS8pm_thumb.jpg", "pivot": { "product_id": 7, "spec_id": 1, "spec_value": "Cappuccino" } } ], "pivot": { "product_id": 2, "spec_id": 1, "spec_value": "Red" } }, { "id": 2, "name": "尺寸", "is_show_img": 2, "select_values": "S\nM\nL\nXL\nXXL\nXXXL", "spu_specs": [ { "id": 2, "name": "尺寸", "product_img": "http://demo.strongshop.local/storage/202103/3bYf4PWe4QpcPIFYUQ2ehpo012jT3esnEoAvHp4d_thumb.jpg", "pivot": { "product_id": 5, "spec_id": 2, "spec_value": "S" } }, { "id": 2, "name": "尺寸", "product_img": "http://demo.strongshop.local/storage/202103/0cNvrdjKAQWebiMU8KIiXjLVctmuyLYumoGlOgMm_thumb.jpg", "pivot": { "product_id": 6, "spec_id": 2, "spec_value": "M" } }, { "id": 2, "name": "尺寸", "product_img": "http://demo.strongshop.local/storage/202103/r1g3ARlVM5bXGdSOJfnaweRNTkbWStb7dAtnS8pm_thumb.jpg", "pivot": { "product_id": 7, "spec_id": 2, "spec_value": "L" } } ], "pivot": { "product_id": 2, "spec_id": 2, "spec_value": "S" } } ] } } ``` #### 返回CODE说明: |参数名|说明| |:----- |----- | |200 |成功 | |3001 |字段验证错误 | |5001|服务内部错误| #### 备注: - 更多返回错误代码请看首页的错误代码描述