12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import request from '@/sheep/request';
- import {
- t
- } from '@/locale';
- const CartApi = {
- addCart: (data) => {
- return request({
- url: '/trade/cart/add',
- method: 'POST',
- data: data,
- custom: {
- showSuccess: true,
- successMsg: t('common.added_to_cart'),
- }
- });
- },
- 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;
|