import request from '@/utils/request'

/**
 * 添加购物车
 */
export function addCart(data: any) {
    return request.post(`product/miniProduct/addProductShoppingCart`, data)
}

/**
 * 编辑购物车数量
 */
export function editCart(data: any) {
    return request.post(`product/miniProduct/updateProductShoppingCart`, data)
}

/**
 * 删除购物车
 */
export function deleteCart(ids: any) {
    return request.delete(`product/miniProduct/deleteProductShoppingCart/${ids}`)
}

/**
 * 清空购物车
 */
export function clearCart() {
    return request.delete(`shop/cart/clear`)
}

/**
 * 获取购物车列表
 */
export function getCartList(params: Record<string, any>) {
    return request.get(`product/miniProduct/getProductShoppingCartPage`, params)
}

/**
 * 获取购物车商品列表
 */
export function getCartGoodsList(params: Record<string, any>) {
    return request.get(`product/miniProduct/getProductShoppingCartPage`, params)
}

/**
 * 获取购物车数量
 */
export function getCartSum(params: Record<string, any>) {
    return request.get(`shop/cart/sum`, params)
}

/**
 * 购物车计算
 */
export function getCartCalculate(params: Record<string, any>) {
    return request.get(`shop/cart/calculate`, params)
}
