import axios from '@/libs/axios.js';

// 添加商品到购物车
export const addGoodsToCart = params => {
  return axios.request({
    url: `shoppingCart/addGoods`,
    method: 'post',
	data: params
  })
};

// 从购物车删除商品
export const deleteGoodsFormCart = params => {
  return axios.request({
    url: `shoppingCart/deleteGoods`,
    method: 'post',
	data: params
  })
};

// 查询购物车列表
export const getCartList = params => {
  return axios.request({
    url: `shoppingCart/queryList`,
    method: 'post',
	data: params
  })
};

// 更新商品购买数量
export const updateGoodsBuyQty = params => {
  return axios.request({
    url: `shoppingCart/updateGoodsBuyQty/${params.id}/${params.buyQty}`,
    method: 'get'
  })
};