50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
"use strict";
|
|
const modules_mall_sheep_request_index = require("../../request/index.js");
|
|
const CartApi = {
|
|
addCart: (data) => {
|
|
return modules_mall_sheep_request_index.request({
|
|
url: "/trade/cart/add",
|
|
method: "POST",
|
|
data,
|
|
custom: {
|
|
showSuccess: true,
|
|
successMsg: "已添加到购物车~"
|
|
}
|
|
});
|
|
},
|
|
updateCartCount: (data) => {
|
|
return modules_mall_sheep_request_index.request({
|
|
url: "/trade/cart/update-count",
|
|
method: "PUT",
|
|
data
|
|
});
|
|
},
|
|
updateCartSelected: (data) => {
|
|
return modules_mall_sheep_request_index.request({
|
|
url: "/trade/cart/update-selected",
|
|
method: "PUT",
|
|
data
|
|
});
|
|
},
|
|
deleteCart: (ids) => {
|
|
return modules_mall_sheep_request_index.request({
|
|
url: "/trade/cart/delete",
|
|
method: "DELETE",
|
|
params: {
|
|
ids
|
|
}
|
|
});
|
|
},
|
|
getCartList: () => {
|
|
return modules_mall_sheep_request_index.request({
|
|
url: "/trade/cart/list",
|
|
method: "GET",
|
|
custom: {
|
|
showLoading: false,
|
|
auth: true
|
|
}
|
|
});
|
|
}
|
|
};
|
|
exports.CartApi = CartApi;
|