购物车
This commit is contained in:
44
api/interfaces/bag.js
Normal file
44
api/interfaces/bag.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
import { req } from "../request"
|
||||
|
||||
// 购物车数量
|
||||
const count = () => req({
|
||||
url: "mall/carts/count"
|
||||
})
|
||||
|
||||
// 加入购物车
|
||||
const add = data => req({
|
||||
url : "mall/carts",
|
||||
method : "POST",
|
||||
data
|
||||
})
|
||||
|
||||
// 购物车列表
|
||||
const list = () => req({
|
||||
url: "mall/carts"
|
||||
})
|
||||
|
||||
// 购物车数量变更
|
||||
const putNum = (cart_id, data) => req({
|
||||
url : "mall/carts/" + cart_id,
|
||||
method : "PUT",
|
||||
data
|
||||
})
|
||||
|
||||
// 删除产品
|
||||
const del = cart_id => req({
|
||||
url : "mall/carts/" + cart_id,
|
||||
method : "DELETE"
|
||||
})
|
||||
|
||||
export default ({
|
||||
count,
|
||||
add,
|
||||
list,
|
||||
putNum,
|
||||
del
|
||||
})
|
||||
Reference in New Issue
Block a user