import request from '../utils/request.js'

import config from '../utils/config'



// 获取购物车列表
export const getShoppingCartData = data => {
	return request.post('/wechat/auth.cart/index', data)
}

// 添加购物车
export const addToShoppingCart = data => {
	return request.post('/wechat/auth.cart/add', data)
}

// 减少购物车数量
export const subShoppingCart = data => {
	return request.post('/wechat/auth.cart/minusCart', data)
}

// 增加购物车数量
export const plusShoppingCart = data => {
	return request.post('/wechat/auth.cart/plusCart', data)
}

// 删除购物车商品
export const deleteShoppingCart = data => {
	return request.post('/wechat/auth.cart/del', data)
}

// 购物车下单
export const createOrderByCart = data => {
	return request.post('/wechat/auth.cart/order', data)
}

// 购物车预下单
export const createPrevOrderByCart = data => {
	return request.post('/wechat/auth.cart/preOrder', data)
}

// 获取购物车统计
export const getCartNumber = data => {
	return request.get('/wechat/auth.index/cart_num', data)
}

// 获取预下单商品运费
export const getPrevCartExpress = data => {
	return request.post('/wechat/auth.cart/getExpress', data)
}
