购物车

This commit is contained in:
唐明明
2023-09-22 09:46:47 +08:00
parent 7ab5dfb2d8
commit 677b0d040a
15 changed files with 686 additions and 201 deletions

44
api/interfaces/bag.js Normal file
View 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
})