mall-uniapp/sheep/api/cart.js

54 lines
948 B
JavaScript
Raw Normal View History

2023-12-11 01:24:16 +00:00
import request from '@/sheep/request';
export default {
list: (data) =>
2023-12-12 08:13:27 +00:00
request({
url: '/app-api/trade/cart/list',
2023-12-11 01:24:16 +00:00
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
}),
append: (data) =>
2023-12-12 08:13:27 +00:00
request({
url: '/app-api/trade/cart/add',
2023-12-11 01:24:16 +00:00
method: 'POST',
custom: {
showSuccess: true,
successMsg: '已添加到购物车~',
},
data: {
...data,
// type: 'inc',
2023-12-11 01:24:16 +00:00
},
}),
// append: (data) =>
// request({
// url: 'cart',
// method: 'POST',
// custom: {
// showSuccess: true,
// successMsg: '已添加到购物车~',
// },
// data: {
// ...data,
// type: 'inc',
// },
// }),
2023-12-11 01:24:16 +00:00
// 删除购物车
delete: (ids) =>
2023-12-12 08:13:27 +00:00
request({
url: '/app-api/trade/cart/delete?ids=' + ids,
2023-12-11 01:24:16 +00:00
method: 'DELETE',
}),
update: (data) =>
2023-12-12 08:13:27 +00:00
request({
url: '/app-api/trade/cart/update-count',
2023-12-11 01:24:16 +00:00
method: 'PUT',
data: {
...data,
type: 'cover',
},
}),
};