// 引入 request 文件
import request from '../common/request.js'

// 购物车数据
export const goodscart = (header) => {
    return request({
        url: '/user/cart',
        method: 'get',
		header:header,
    })
}

//购物车选中或取消
export const cartcheck = (params,data,header) => {
    return request({
        url: '/user/cart/check/'+params+'?check='+data,
        method: 'put',
		header:header,
    })
}
//购物车批量选中或取消
export const cartcheckpiliang = (params,header) => {
    return request({
        url: '/user/cart/batchCheck'+params,
    method: 'put',
		header:header,
    })
}
//修改购物车接口
export const changecart = (params,header) => {
    return request({
        url: '/user/cart/'+params,
        method: 'put',
		header:header,
    })
}
//删除购物车
export const deletecart = (params,header) => {
    return request({
        url: '/user/cart/'+params,
        method: 'delete',
		header:header,
    })
}
//清空购物车
export const clearcart = (header) => {
    return request({
        url: '/user/cart/clear',
        method: 'delete',
		header:header,
    })
}