You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
780 B

1 year ago
import request from '@/sheep/request';
export default {
list: (data) =>
request({
url: 'cart',
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
}),
append: (data) =>
request({
url: 'cart/update',
method: 'POST',
custom: {
showSuccess: true,
successMsg: '已添加到购物车~',
},
data: {
...data,
type: 'inc',
},
}),
// 删除购物车
delete: (ids) =>
request({
url: 'cart/delete',
method: 'DELETE',
params: {
id: ids.toString(),
},
}),
update: (data) =>
request({
url: 'cart/update',
method: 'POST',
data: {
...data,
type: 'cover',
},
}),
};