acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/api/trade/cart.js
2024-10-01 09:15:35 +08:00

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;