2024-01-05 01:21:52 +00:00
|
|
|
import request from '@/sheep/request';
|
2023-12-15 16:09:01 +00:00
|
|
|
|
|
|
|
const CartApi = {
|
|
|
|
addCart: (data) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/trade/cart/add',
|
2023-12-15 16:09:01 +00:00
|
|
|
method: 'POST',
|
|
|
|
data: data,
|
|
|
|
custom: {
|
|
|
|
showSuccess: true,
|
|
|
|
successMsg: '已添加到购物车~',
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
updateCartCount: (data) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/trade/cart/update-count',
|
2023-12-15 16:09:01 +00:00
|
|
|
method: 'PUT',
|
|
|
|
data: data
|
|
|
|
});
|
|
|
|
},
|
|
|
|
updateCartSelected: (data) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/trade/cart/update-selected',
|
2023-12-15 16:09:01 +00:00
|
|
|
method: 'PUT',
|
|
|
|
data: data
|
|
|
|
});
|
|
|
|
},
|
|
|
|
deleteCart: (ids) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/trade/cart/delete',
|
2023-12-15 16:09:01 +00:00
|
|
|
method: 'DELETE',
|
|
|
|
params: {
|
|
|
|
ids
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getCartList: () => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/trade/cart/list',
|
2023-12-15 16:09:01 +00:00
|
|
|
method: 'GET',
|
2024-01-20 09:28:04 +00:00
|
|
|
custom: {
|
|
|
|
showLoading: false,
|
|
|
|
auth: true,
|
|
|
|
},
|
2023-12-15 16:09:01 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default CartApi;
|