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

import config from '../utils/config'

// 获取积分商品列表
export const getPointsGoodsList = data => {
	return request.post('/wechat/goods/integrals', data)
}


// 获取满赠商品列表
export const getGiftGoodsList = data => {
	return request.post('/wechat/goods/gifts', data)
}

// 获取满赠商品详情
export const getGiftGoodsDetail = data => {
	return request.post('/wechat/goods/gift', data)
}

// 满赠商品加入购物车
export const giftAddCart = data => {
	return request.post('/wechat/auth.gift/addCart', data)
}

//获取秒杀商品详情
export const getMsGoodsDetail = data => {
	return request.post('/wechat/goods/seckillGoods', data)
}

//获取秒杀商品列表
export const getMsGoodsList = data => {
	return request.post('/wechat/goods/seckills', data)
}

// 秒杀商品下单
export const msGoodsCreateOrder = data => {
	return request.post('/wechat/auth.seckill/add', data)
}

// 获取积分商品详情
export const getPointsGoodsDetail = data => {
	return request.post('/wechat/goods/integral', data)
}

// 获取商品详情
export const getGoodsDetail = data => {
	return request.post('/wechat/goods/read', data)
}

// 通过规格获取价格
export const getPriceBySuit = data => {
	return request.post('/wechat/goods/specPrice', data)
}

// 获取商品列表
export const getGoodList = data => {
	return request.post('/wechat/goods/index', data)
}
// 获取商品分类
export const getGoodCate = data => {
	return request.get('/wechat/goods/getCate', data)
}

// 添加收藏
export const addCollect = data => {
	return request.post('/wechat/auth.goods/addCollect', data)
}

// 删除收藏
export const delCollect = data => {
	return request.post('/wechat/auth.goods/delCollect', data)
}

// 判断收藏
export const checkCollect = data => {
	return request.post('/wechat/auth.goods/getCollect', data)
}

// 收藏列表
export const getcollectList = data => {
	return request.post('/wechat/auth.goods/getCollects', data)
}


// 添加评论
export const addComment = data => {
	return request.post('/data/api.auth.goods/addComment', data)
}

// 添加点赞
export const addLike = data => {
	return request.post('/data/api.auth.goods/addLike', data)
}

// 删除点赞
export const delLike = data => {
	return request.post('/data/api.auth.goods/delLike', data)
}

// 添加评论点赞
export const reviewLike = data => {
	return request.post('/data/api.auth.goods/reviewLike', data)
}

// 删除评论点赞
export const delComment = data => {
	return request.post('/data/api.auth.goods/delComment', data)
}
