Skip to content
关注公众号,获取新课通知

获取指定商品详情


接口功能

获取首页分类和基础数据

URL

http://ceshi3.dishait.cn/api/goods/:id

支持格式

JSON

HTTP请求方式

GET

请求参数
参数必选类型说明
idtrueint商品id
接口示例

地址:http://ceshi3.dishait.cn/api/goods/25

json5
{
	"msg": "ok",
	"data": {
		"id": 25,
		"title": "小米空调",
		"category_id": 1,
		"cover": "http://...png",
		"rating": 5,
		"sale_count": 0,
		"review_count": 0,
		"min_price": "25.00",
		"min_oprice": "30",
		"desc": "全新...挑选",
		"unit": "kg",
		"stock": 200,
		"min_stock": 10,
		"ischeck": 1,
		"status": 1,
		"stock_display": 1,
		"express_id": 1,
		"sku_type": 1,
		"sku_value": {
			"oprice": 20,
			"pprice": 30,
			"cprice": 20,
			"weight": 10,
			"volume": 20
		},
		"goods_type_id": 2,
		"content": "<img ....>",
		"discount": 10,
		"create_time": "2019-08-25 17:43:24",
		"update_time": "2019-08-25 17:43:24",
		"delete_time": null,
		"order": 50,
		"hotComments": [{
				"id": 2,
				"goods_id": 25,
				"user_id": 3,
				"goods_num": 20,
				"context": "好评,靓仔",
				"imglist": {
					"0": {
						"id": 1,
						"src": "/static/...png"
					}
				},
				"create_time": "2019-08-25 17:43:24",
				"update_time": "2019-08-25 17:43:24",
				"user": {
					"id": 3,
					"nickname": "...",
					"avatar": "http://...png",
				}
			},
			// ...
		],
		"hotList": [{
				"id": 28,
				"title": "小米空调",
				"cover": "http://...png",
				"desc": "全新十...你挑选",
				"min_price": "25.00",
				"min_oprice": "30"
			},
			// ...
		],
		"goodsBanner": [{
				"id": 1,
				"goods_id": 25,
				"url": "http://...png",
				"create_time": "2019-09-23 13:55:25",
				"update_time": "2019-09-23 13:55:25"
			},
			// ...
		],
		"goodsAttrs": [{
				"id": 3,
				"goods_id": 25,
				"order": 50,
				"value": "...",
				"name": "CPU",
				"default": "默认值",
				"type": 0
			},
			// ...
		],
		"goodsSkus": [{
				"id": 2,
				"image": "",
				"pprice": "5.00",
				"oprice": "2.00",
				"cprice": "10.00",
				"stock": 4,
				"volume": 5,
				"weight": 6,
				"code": "666",
				"goods_id": 25,
				"skus": {
					"0": {
						"goods_skus_card_id": 1,
						"id": 1,
						"name": "颜色",
						"value": "黄色"
					},
					// ...
				}
			},
			// ...
		],
		"goodsSkusCard": [{
				"id": 1,
				"goods_id": 25,
				"name": "颜色",
				"type": 0,
				"order": 50,
				"goodsSkusCardValue": [{
						"id": 1,
						"goods_skus_card_id": 1,
						"name": "颜色",
						"value": "黄色",
						"order": 50
					},
					// ...
				]
			},
			// ...
		]
	}
}