cart.js 900 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import request from '@/sheep/request';
  2. const CartApi = {
  3. addCart: (data) => {
  4. return request({
  5. url: '/app-api/trade/cart/add',
  6. method: 'POST',
  7. data: data,
  8. custom: {
  9. showSuccess: true,
  10. successMsg: '已添加到购物车~',
  11. }
  12. });
  13. },
  14. updateCartCount: (data) => {
  15. return request({
  16. url: '/app-api/trade/cart/update-count',
  17. method: 'PUT',
  18. data: data
  19. });
  20. },
  21. updateCartSelected: (data) => {
  22. return request({
  23. url: '/app-api/trade/cart/update-selected',
  24. method: 'PUT',
  25. data: data
  26. });
  27. },
  28. deleteCart: (ids) => {
  29. return request({
  30. url: '/app-api/trade/cart/delete',
  31. method: 'DELETE',
  32. params: {
  33. ids
  34. }
  35. });
  36. },
  37. getCartList: () => {
  38. return request({
  39. url: '/app-api/trade/cart/list',
  40. method: 'GET',
  41. });
  42. },
  43. };
  44. export default CartApi;