import request from '@/utils/request';

// 获取商品列表
export const getGoodsList = () => request('/point/goods', {}, 'POST');

// 添加购物车
export const addCart = (data: object) => request('/user/addCart', data, 'POST');

// 获取购物车列表
export const getCartList = () => request('/user/cart', {}, 'POST');

// 获取积分商品详情
export const getGoodsDetail = (data: object) =>
  request('/point/details', data, 'POST');

// 积分商品下单
export const createOrder = (data: object) =>
  request('/point/place', data, 'POST');

// 确认付款
export const payJfOrder = (data: object) =>
  request('/point/confirmOrder', data, 'POST');

// 获取活动商品
export const getActiveGoods = () => request('/goods', {}, 'POST');

// 获取活动商品详情
export const getActiveGoodsDetail = (data: object) =>
  request('/goods/details', data, 'POST');

// 创建订单
export const createActiveOrder = (data: object) =>
  request('/order/place', data, 'POST');

// 活动订单列表
export const getActiveOrderList = (data: object) =>
  request('/user/order', data, 'POST');

// 获取分类列表
export const getCategoryList = () => request('/goods/class', {}, 'POST');

// 活动订单删除
export const deleteActiveOrder = (data: object) =>
  request('/user/order/remove', data, 'POST');

// 积分订单删除
export const deleteJfOrder = (data: object) =>
  request('/user/point/remove', data, 'POST');

// 获取分类商品
export const getCategoryGoods = (data: object) =>
  request('/class/goods/list', data, 'POST');

// 获取商家列表
export const getMerList = (data: object) =>
  request('/store/list', data, 'POST');

// 获取商家商品分类
export const getMerCategory = (data: object) =>
  request('/store/classify', data, 'POST');

// 获取商家商品
export const getGoodList = (data: object) =>
  request('/store/goods', data, 'POST');

// // 获取活动商家列表
// export const getHotMerList = (data: object) =>
//     request("/store/list", data, "POST");

// // 获取活动商家商品分类
// export const getHotMerCategory = (data: object) =>
//     request("/store/classify", data, "POST");

// // 获取活动商家商品
// export const getHotGoodList = (data: object) =>
//     request("/store/goods", data, "POST");

// 获取全部商家类目
export const getAllMerCategory = () =>
  request('/home/all/classify', {}, 'POST');

// 获取活动订单详情
export const getActiveOrderDetail = (data: object) =>
  request('/user/order/details', data, 'POST');

// 校验交易密码
export const checkTradePwd = (data: object) =>
  request('/user/check/payPassword', data, 'POST');
