用户购物车列表接口:
GET/&route=plugin.store-scan-code-meals.frontend.meals-member-cart.index
请求参数说明:
参数名 | 类型 | 是否必需 | 说明 |
---|---|---|---|
store_id | int | 是 | 门店ID |
返回示例:
正确时返回:
{
"result": 1,
"msg": "获取列表成功",
"data": [
{
"id": 2,
"uniacid": 6,
"store_id": 8,
"member_id": 2455,
"goods_id": 264,
"option_id": 0,
"total": 1,
"created_at": "2025-08-19 14:20:36",
"qty": 1,
"goods_title": "点餐商品1",
"goods_thumb": "http://demo.yun.cn/static/upload/images/6/2024/05/6baa2ebdbbc03f9632011014f6b215d4.jpg",
"goods_option_title": "",
"goods_price": "99.00",
"goods_option": null,
"is_failure": 0,
"option_str": ""
}
]
}
购物车列表参数说明:
参数名 | 类型 | 说明 | |
---|---|---|---|
id | int | 购物车ID | |
goods_id | int | 商品ID | |
option_id | int | 商品规格ID | |
total | int | 购物数量 | |
qty | int | 购物数量 | |
goods_price | int | 商品单价 | |
goods_title | int | 商品名称 | |
goods_thumb | int | 商品图片 | |
goods_option_title | int | 商品规格名称 |
添加购物车接口:
GET/&route=plugin.store-scan-code-meals.frontend.meals-member-cart.store
请求参数说明:
参数名 | 类型 | 是否必需 | 说明 |
---|---|---|---|
store_id | int | 是 | 门店ID |
goods_id | int | 是 | 商品ID |
total | int | 是 | 数量 |
option_id | int | 否 | 规格ID |
返回示例:
正确时返回:
{
"result": 1,
"msg": "",
"data": {
"cart_id": 1,
}
}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
cart_id | int | 购物车Id |
修改购物车数量接口:
GET/&route=plugin.store-scan-code-meals.frontend.meals-member-cart.updateNumV2
请求参数说明:
参数名 | 类型 | 是否必需 | 说明 |
---|---|---|---|
id | int | 是 | 购物车ID |
num | int | 是 | 数量 |
购物车删除:
GET/&route=plugin.store-scan-code-meals.frontend.meals-member-cart.destroy
请求参数说明:
参数名 | 类型 | 是否必需 | 说明 |
---|---|---|---|
ids | string | 是 | 购物车ID,多个使用 逗号 拼接 |
错误时返回:
- 缺少访问参数 - 商品ID
{
"result": 0,
"msg": "缺少访问参数",
"data": [ ]
}