购物车
This commit is contained in:
@@ -36,6 +36,9 @@ import withdraw from "./interfaces/withdraw"
|
||||
// 售后服务
|
||||
import refund from "./interfaces/refund"
|
||||
|
||||
// 购物袋
|
||||
import bag from "./interfaces/bag"
|
||||
|
||||
export default {
|
||||
auth,
|
||||
bank,
|
||||
@@ -47,5 +50,6 @@ export default {
|
||||
pay,
|
||||
idcard,
|
||||
withdraw,
|
||||
refund
|
||||
refund,
|
||||
bag
|
||||
}
|
||||
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
|
||||
})
|
||||
@@ -7,9 +7,9 @@ import { errInfo } from './err'
|
||||
import { updToken } from './updateToken'
|
||||
|
||||
// 正式地址
|
||||
const api = "https://api.xuanhuojk.com/api/"
|
||||
// const api = "https://api.xuanhuojk.com/api/"
|
||||
// 测试地址
|
||||
// const api = "https://api.xhtest.douhuofalv.com/api/"
|
||||
const api = "https://api.xhtest.douhuofalv.com/api/"
|
||||
const header = {
|
||||
"Accept" : "application/json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user