acdr/acdr-admin/yskj-ui/yskj-ui-mall-uniapp/sheep/api/trade/cart.js

50 lines
933 B
JavaScript
Raw Normal View History

2024-09-05 14:05:15 +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: '已添加到购物车~',
}
});
},
updateCartCount: (data) => {
return request({
url: '/trade/cart/update-count',
method: 'PUT',
data: data
});
},
updateCartSelected: (data) => {
return request({
url: '/trade/cart/update-selected',
method: 'PUT',
data: data
});
},
deleteCart: (ids) => {
return request({
url: '/trade/cart/delete',
method: 'DELETE',
params: {
ids
}
});
},
getCartList: () => {
return request({
url: '/trade/cart/list',
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
});
},
};
export default CartApi;