acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/api/trade/cart.js

50 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
2024-10-01 09:15:35 +08:00
const modules_mall_sheep_request_index = require("../../request/index.js");
2024-09-19 07:20:14 +08:00
const CartApi = {
addCart: (data) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/cart/add",
method: "POST",
data,
custom: {
showSuccess: true,
successMsg: "已添加到购物车~"
}
});
},
updateCartCount: (data) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/cart/update-count",
method: "PUT",
data
});
},
updateCartSelected: (data) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/cart/update-selected",
method: "PUT",
data
});
},
deleteCart: (ids) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/cart/delete",
method: "DELETE",
params: {
ids
}
});
},
getCartList: () => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/cart/list",
method: "GET",
custom: {
showLoading: false,
auth: true
}
});
}
};
exports.CartApi = CartApi;