|
@@ -23,3 +23,56 @@ export const apiProductDetail = (id) => request({
|
|
|
id
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+/**
|
|
|
+ * 购物车商品列表
|
|
|
+ * @param id 酒吧ID
|
|
|
+ * @param page 第几页
|
|
|
+ * @param pageSize 每页数量
|
|
|
+ */
|
|
|
+export const apiCartList = (id, page, pageSize = 20) => request({
|
|
|
+ method: 'GET',
|
|
|
+ url: '/api/v1/user/cart/list',
|
|
|
+ params: {
|
|
|
+ id,
|
|
|
+ page,
|
|
|
+ page_size: pageSize
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+/**
|
|
|
+ * 清空购物车
|
|
|
+ * @param id 酒吧ID
|
|
|
+ */
|
|
|
+export const apiCartClear = (id) => request({
|
|
|
+ method: 'GET',
|
|
|
+ url: '/api/v1/user/cart/clear',
|
|
|
+ params: {
|
|
|
+ id
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+/**
|
|
|
+ * 更新购物车
|
|
|
+ * @param id 购物车数据ID
|
|
|
+ * @param type 类型(0减少1增加)
|
|
|
+ */
|
|
|
+export const apiCartUpdate = (id, type) => request({
|
|
|
+ method: 'POST',
|
|
|
+ url: '/api/v1/user/cart/update',
|
|
|
+ data: {
|
|
|
+ id,
|
|
|
+ type
|
|
|
+ }
|
|
|
+})
|
|
|
+/**
|
|
|
+ * 添加商品到购物车
|
|
|
+ * @param postData
|
|
|
+ */
|
|
|
+export const apiCartAdd = (postData) => request({
|
|
|
+ method: 'POST',
|
|
|
+ url: '/api/v1/user/cart/add',
|
|
|
+ data: {
|
|
|
+ postData
|
|
|
+ }
|
|
|
+})
|