zyejMAll-mobile/sheep/api/trade/cart.js

51 lines
939 B
JavaScript
Raw Normal View History

2024-08-07 10:31:42 +08:00
import request from '@/sheep/request';
const CartApi = {
addCart: (data) => {
return request({
url: '/trade/cart/add',
method: 'POST',
data: data,
custom: {
showSuccess: true,
successMsg: '已添加到购物车~',
2024-08-07 21:40:27 +08:00
},
2024-08-07 10:31:42 +08:00
});
},
updateCartCount: (data) => {
return request({
url: '/trade/cart/update-count',
method: 'PUT',
2024-08-07 21:40:27 +08:00
data: data,
2024-08-07 10:31:42 +08:00
});
},
updateCartSelected: (data) => {
return request({
url: '/trade/cart/update-selected',
method: 'PUT',
2024-08-07 21:40:27 +08:00
data: data,
2024-08-07 10:31:42 +08:00
});
},
deleteCart: (ids) => {
return request({
url: '/trade/cart/delete',
method: 'DELETE',
params: {
2024-08-07 21:40:27 +08:00
ids,
},
2024-08-07 10:31:42 +08:00
});
},
getCartList: () => {
return request({
url: '/trade/cart/list',
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
});
},
};
2024-08-07 21:40:27 +08:00
export default CartApi;