简要描述:
接口版本:
版本号 |
制定人 |
制定日期 |
修订日期 |
1.0.0 |
孙程 |
2019-06-04 |
|
请求URL:
请求方式:
请求头:
参数名 |
是否必须 |
类型 |
说明 |
Content-Type |
|
|
|
Content-MD5 |
|
|
|
请求参数:
参数名 |
是否必须 |
类型 |
说明 |
uid |
是 |
int |
用户id |
goods_id |
否 |
int |
商品id buy now 必须 |
cate_id |
否 |
int |
分类id buy now 必须 |
options |
否 |
int |
规格选项 buy now 必须 |
qty |
否 |
int |
数量 buy now 必须 |
step |
否 |
string |
‘now’ buy now 必须 |
返回示例:
正确时返回(例子):
{
"errorcode": 0,
"msg": "请求成功",
"consignee": [
{
"id": 1,
"user_id": 99,
"receiver": "ahmai",
"province": 1,
"city": 54,
"borough": 3,
"address": "缅甸密支那",
"zip": "000102",
"mobile": "13890987648",
"is_default": 0
},
{
"id": 2,
"user_id": 99,
"receiver": "唐义早",
"province": 2,
"city": 13,
"borough": 7,
"address": "云南德宏瑞丽市",
"zip": "518055",
"mobile": "12898748790",
"is_default": 1
}
],
"shipping_method": [
{
"id": 1,
"name": "普通快递",
"params": "{\"0\":{\"type\":\"fixed\",\"area\":\"0\",\"charges\":\"0\"}}",
"instruction": "全国范围免邮",
"seq": 1,
"enable": 1
}
],
"payment_method": [
{
"id": 1,
"name": "余额支付",
"type": 0,
"pcode": "balance",
"params": "[\"\"]",
"instruction": "",
"seq": 2,
"enable": 1
},
{
"id": 2,
"name": "货到付款",
"type": 1,
"pcode": "cod",
"params": "[\"\"]",
"instruction": "",
"seq": 3,
"enable": 1
},
{
"id": 3,
"name": "支付宝",
"type": 0,
"pcode": "alipay",
"params": "{\"seller\":\"\",\"partner\":\"\",\"key\":\"\"}",
"instruction": "",
"seq": 1,
"enable": 1
}
],
"carts": {
"0": {
"id": 535,
"user_id": 99,
"goods_id": 17,
"goods_name": "雪纺衫女长袖2019春装新款打底衫女韩版衬衫女宽松雪纺上衣女小衫",
"now_price": "15.90",
"goods_image": "685cd3e99b833e1.jpg",
"cate_id": 71,
"spec": [
[
{
"id": 43,
"type_id": 1,
"goods_id": 17,
"opt_text": "黄色",
"name": "颜色"
}
],
[
{
"id": 48,
"type_id": 2,
"goods_id": 17,
"opt_text": "M",
"name": "尺码"
}
]
],
"qty": 1,
"created_date": "2019-06-04 12:46:53"
},
"1": {
"id": 534,
"user_id": 99,
"goods_id": 17,
"goods_name": "雪纺衫女长袖2019春装新款打底衫女韩版衬衫女宽松雪纺上衣女小衫",
"now_price": "15.90",
"goods_image": "685cd3e99b833e1.jpg",
"cate_id": 71,
"spec": [
[
{
"id": 44,
"type_id": 1,
"goods_id": 17,
"opt_text": "黑色",
"name": "颜色"
}
],
[
{
"id": 49,
"type_id": 2,
"goods_id": 17,
"opt_text": "L",
"name": "尺码"
}
]
],
"qty": 2,
"created_date": "2019-06-04 12:46:24"
},
"2": {
"id": 533,
"user_id": 99,
"goods_id": 17,
"goods_name": "雪纺衫女长袖2019春装新款打底衫女韩版衬衫女宽松雪纺上衣女小衫",
"now_price": "15.90",
"goods_image": "685cd3e99b833e1.jpg",
"cate_id": 71,
"spec": [
[
{
"id": 46,
"type_id": 1,
"goods_id": 17,
"opt_text": "粉红",
"name": "颜色"
}
],
[
{
"id": 51,
"type_id": 2,
"goods_id": 17,
"opt_text": "2XL",
"name": "尺码"
}
]
],
"qty": 1,
"created_date": "2019-06-04 12:46:14"
},
"3": {
"id": 532,
"user_id": 99,
"goods_id": 17,
"goods_name": "雪纺衫女长袖2019春装新款打底衫女韩版衬衫女宽松雪纺上衣女小衫",
"now_price": "15.90",
"goods_image": "685cd3e99b833e1.jpg",
"cate_id": 71,
"spec": "",
"qty": 3,
"created_date": "2019-06-04 11:08:59"
},
"4": {
"id": 531,
"user_id": 99,
"goods_id": 1,
"goods_name": "【断底断面包退换】内增高网面小白鞋女夏韩版休闲运动鞋女",
"now_price": "30.60",
"goods_image": "915cd1bcdcbef0d.jpg",
"cate_id": 71,
"spec": "",
"qty": 1,
"created_date": "2019-06-04 11:00:18"
},
"total_amount": "141.90"
}
}
错误时返回:
{
"errcode": -1,
"msg": "请求失败"
}
返回参数说明:
consignee收件人地址
参数名 |
类型 |
说明 |
id |
int |
地址id |
user_id |
int |
用户id |
receiver |
string |
收件人 |
province |
int |
省 |
city |
int |
市 |
borough |
int |
区 |
address |
string |
地址详情 |
zip |
string |
邮编 |
mobile |
string |
手机号 |
is_default |
int |
是否默认地址 |
shipping_method 配送方式
参数名 |
类型 |
说明 |
id |
int |
配送方式id |
name |
string |
配送方式名称 |
enable |
int |
是否开启 |
payment_method支付方式:余额支付、货到付款、支付宝
参数名 |
类型 |
说明 |
id |
int |
支付方式id |
name |
string |
支付方式名称 |
pcode |
string |
支付方式代码 |
enable |
int |
是否开启 |
carts购物车详情
参数名 |
类型 |
说明 |
id |
int |
购物车id |
user_id |
int |
用户id |
goods_id |
int |
商品id |
goods_name |
string |
商品名称 |
goods_brief |
string |
商品简介 |
goods_image |
string |
主图 完整配置路径示例F:/sun/union-shop/PHP/public/uploads/goods/prime/0/文件名 |
now_price |
float |
商品价格 |
cate_id |
int |
分类id |
goods_id |
int |
商品id |
spec |
array |
产品规格 |
qty |
int |
购买数量 |
错误代码:
参数名 |
说明 |
201 |
请求方式错误 |
202 |
参数错误 |
文档更新时间: 2019-07-15 19:55 作者:jetsamsun