GET代码目录
/tool/open_api/api/user/cart
请求Params
请求 Header
响应定义
请求参数
Query参数
Header参数
数据结构
export interface Response {
code: number;
data: Data;
}
export interface Data {
/**
* 购物车列表
*/
list: List[];
/**
* 发货方式自定义名称
*/
sendTypeDesc: SendTypeDesc;
}
export interface List {
/**
* 商品列表
*/
goodsList?: GoodsList[];
/**
* 是否选中
*/
isActive?: boolean;
/**
* 商户id,0--平台,其他--多商户id
*/
mchid?: number;
/**
* 商户名称
*/
name?: string;
/**
* 商户状态
*/
newStatus?: number;
}
export interface GoodsList {
/**
* 商品规格id
*/
attrid?: number;
/**
* 规格快照
*/
attrInfo?: string;
/**
* 规格信息
*/
attrs?: Attrs;
/**
* 是否可购买
*/
buyGoodsAuth?: boolean;
/**
* 商品信息
*/
goods?: Goods;
/**
* 商品id
*/
goodsid?: number;
/**
* 购物车id
*/
id: number;
/**
* 是否选中
*/
isActive?: boolean;
/**
* 是否结束销售
*/
isFinishSell?: boolean;
/**
* 商品状态
*/
newStatus?: number;
/**
* 数量
*/
num?: number;
/**
* 和加入时价格差
*/
reducePrice?: number;
/**
* 开售倒计时,单位:秒
*/
sellTime?: number;
/**
* 允许的发货方式
*/
sendType?: SendType[];
/**
* 插件标示
*/
sign?: string;
}
/**
* 规格信息
*/
export interface Attrs {
/**
* 规格
*/
attr: Attr[];
/**
* 条形码
*/
barCode: string;
/**
* 成本价
*/
costPrice: string;
/**
* 规格id
*/
id: number;
/**
* 货号
*/
no: string;
/**
* 规格图片
*/
picurl: string;
/**
* 价格
*/
price: string;
/**
* 总库存
*/
stock: number;
/**
* 重量
*/
weight: number;
}
export interface Attr {
/**
* 规格组id
*/
attrGroupid: number;
/**
* 规格组名称
*/
attrGroupName: string;
/**
* 规格id
*/
attrid: number;
/**
* 规格名称
*/
attrName: string;
}
/**
* 商品信息
*/
export interface Goods {
/**
* 商品封面图
*/
coverPic: string;
/**
* 商品id
*/
id: number;
/**
* 商品名称
*/
name: string;
/**
* 售价
*/
price: string;
/**
* 商品状态
*/
status: number;
}
export type SendType = "express" | "offline" | "city";
/**
* 发货方式自定义名称
*/
export interface SendTypeDesc {
/**
* 同城配送
*/
city: string;
/**
* 快递配送
*/
express: string;
/**
* 无配送
*/
none: string;
/**
* 到店自提
*/
offline: string;
}
示例代码
{
"code": 0,
"data": {
"list": [
{
"mch_id": 0,
"is_active": true,
"new_status": 0,
"name": "string",
"goods_list": [
{
"id": 0,
"goods_id": 0,
"attr_id": 0,
"num": 0,
"sign": "string",
"attr_info": "string",
"buy_goods_auth": true,
"send_type": [
"express"
],
"sell_time": 0,
"is_finish_sell": true,
"goods": {
"id": 0,
"status": 0,
"price": "string",
"name": "string",
"cover_pic": "string"
},
"attrs": {
"id": 0,
"stock": 0,
"price": "string",
"no": "string",
"weight": 0,
"pic_url": "string",
"bar_code": "string",
"cost_price": "string",
"attr": [
{
"attr_group_name": "string",
"attr_group_id": 0,
"attr_id": 0,
"attr_name": "string"
}
]
},
"reduce_price": 0,
"is_active": true,
"new_status": 0
}
]
}
],
"send_type_desc": {
"express": "string",
"offline": "string",
"city": "string",
"none": "string"
}
}
}