商品详细接口
<h5>简要描述</h5>
<ul>
<li>商品详情接口</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://xx.com/api/shop/product/detail</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET </li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">product_id</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">int</td>
<td>商品ID</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<pre><code> {
"code": 200,
"data": {
"id": 46,
"cate_id": 2,
"cate_name": "上衣",
"title": "测试商品标题",
"subtitle": "Dr.",
"image": "/shop/demo/product_demo.jpeg",
"video": null,
"price": "99.00",
"market_price": "199.00",
"gold": 0,
"content": null,
"onsale_time": 0,
"status": 1,
"is_virtual": 0,
"created_at": null,
"updated_at": null,
"is_coll":false,
"images": [
{
"id": 7,
"product_id": 46,
"type": 1,
"file_name": "Dorthy Gorczany III",
"file_path": "/shop/demo/product_demo.png",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 8,
"product_id": 46,
"type": 1,
"file_name": "Mr. Hayley Okuneva",
"file_path": "/shop/demo/product_demo.png",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 9,
"product_id": 46,
"type": 1,
"file_name": "Marquise Hettinger",
"file_path": "/shop/demo/product_demo.png",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 10,
"product_id": 46,
"type": 1,
"file_name": "Mr. Vidal Macejkovic",
"file_path": "/shop/demo/product_demo.png",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 11,
"product_id": 46,
"type": 1,
"file_name": "Alexane Grady",
"file_path": "/shop/demo/product_demo.png",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
}
],
"details": [
{
"id": 12,
"product_id": 46,
"type": 2,
"file_name": "Otis Schultz",
"file_path": "/shop/demo/product_detail.jpeg",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 13,
"product_id": 46,
"type": 2,
"file_name": "Gaston Fisher",
"file_path": "/shop/demo/product_detail.jpeg",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 14,
"product_id": 46,
"type": 2,
"file_name": "Tyrique Raynor",
"file_path": "/shop/demo/product_detail.jpeg",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 15,
"product_id": 46,
"type": 2,
"file_name": "Delpha Becker",
"file_path": "/shop/demo/product_detail.jpeg",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
},
{
"id": 16,
"product_id": 46,
"type": 2,
"file_name": "Hazle Brekke",
"file_path": "/shop/demo/product_detail.jpeg",
"file_size": 0,
"sort": 50,
"created_at": null,
"updated_at": null
}
],
"spec_list": [
{
"id": 1,
"spec_name": "颜色",
"values": [
{
"id": 1,
"spec_value": "红色",
"type": 1,
"image": ""
},
{
"id": 2,
"spec_value": "蓝色",
"type": 1,
"image": ""
},
{
"id": 3,
"spec_value": "白色",
"type": 1,
"image": ""
}
]
},
{
"id": 2,
"spec_name": "尺码",
"values": [
{
"id": 4,
"spec_value": "S",
"type": 1,
"image": ""
},
{
"id": 5,
"spec_value": "M",
"type": 1,
"image": ""
},
{
"id": 6,
"spec_value": "L",
"type": 1,
"image": ""
}
]
}
],
"sku_list": [
{
"sku_id": 33,
"sku_spec": "红色/S",
"price": "479.24",
"market_price": "484.24",
"stock": 999
},
{
"sku_id": 34,
"sku_spec": "红色/M",
"price": "173.91",
"market_price": "178.91",
"stock": 999
},
{
"sku_id": 35,
"sku_spec": "红色/L",
"price": "305.58",
"market_price": "310.58",
"stock": 999
},
{
"sku_id": 36,
"sku_spec": "蓝色/S",
"price": "77.05",
"market_price": "82.05",
"stock": 999
},
{
"sku_id": 37,
"sku_spec": "蓝色/M",
"price": "113.07",
"market_price": "118.07",
"stock": 999
},
{
"sku_id": 38,
"sku_spec": "蓝色/L",
"price": "184.05",
"market_price": "189.05",
"stock": 999
},
{
"sku_id": 39,
"sku_spec": "白色/S",
"price": "224.57",
"market_price": "229.57",
"stock": 999
},
{
"sku_id": 40,
"sku_spec": "白色/M",
"price": "493.67",
"market_price": "498.67",
"stock": 999
},
{
"sku_id": 41,
"sku_spec": "白色/L",
"price": "109.26",
"market_price": "114.26",
"stock": 999
}
]
},
"message": ""
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">images</td>
<td style="text-align: left;">Array</td>
<td>商品轮播图</td>
</tr>
<tr>
<td style="text-align: left;">details</td>
<td style="text-align: left;">Array</td>
<td>商品详情图</td>
</tr>
<tr>
<td style="text-align: left;">spec_list</td>
<td style="text-align: left;">Array</td>
<td>SKU规格列表</td>
</tr>
<tr>
<td style="text-align: left;">sku_list</td>
<td style="text-align: left;">Array</td>
<td>SKU列表</td>
</tr>
<tr>
<td style="text-align: left;">is_coll</td>
<td style="text-align: left;">Bool</td>
<td>是否收藏:true/false</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>
<p>欢迎使用ShowDoc!</p>