import request from '@/utils/request';

// 获取用户协议
export const getAgreement = () => request('/user/agreement', {}, 'POST');

// 登录
export const login = (data: object) => request('/login', data, 'POST');
export const phoneLogin = (data: object) =>
  request('/phone/login', data, 'POST');

// 获取用户信息
// export const getUserInfo = () => request("/user/detail", {}, "GET");

// 获取短信验证码
export const getVerifyCode = (data: object) =>
  request('/getSmsCode', data, 'POST');

// 商家入驻申请
export const applyMer = (data: object) =>
  request('/store/settle', data, 'POST');

// 获取商家类型列表
export const getMerTypeList = () => request('/store/getOther', {}, 'POST');

// 获取个人信息
export const getPersonalInfo = () => request('/user/info', {}, 'POST');

// 获取轮播图
export const getBanner = () => request('/rotation', {}, 'POST');

// 获取积分订单列表
export const getIntegralOrderList = (data: object) =>
  request('/user/pointOrder', data, 'POST');

// 修改个人信息
export const editPersonalInfo = (data: object) =>
  request('/user/editInfo', data, 'POST');

// 积分明细
export const getIntegralDetail = (data: object) =>
  request('/user/pulseRecord', data, 'POST');

// 豆子明细
export const getBeanDetail = (data: object) =>
  request('/user/pointRecord', data, 'POST');

// 授权手机号
export const getPhone = (data: object) =>
  request('/user/getPhone', data, 'POST');

// 获取推广积分明细
export const getTGIntegralDetail = (data: object) =>
  request('/user/referee/point', data, 'POST');

// 获取推广用户列表
export const getTGUserList = (data: object) =>
  request('/user/referee/list', data, 'POST');

//  绑定上级
export const bindParent = (data: object) =>
  request('/user/bindCode', data, 'POST');

// 获取推广码
export const getRefereeCode = () => request('/user/promotion', {}, 'POST');

// 取消订单返回积分
export const qxOrder = (data: object) =>
  request('/user/point/off', data, 'POST');

// 用户签到
export const userSign = () => request('/sign/user', {}, 'POST');

// 获取签到记录
export const getSignRecord = () => request('/sign/pulse/count', {}, 'POST');

// 获取赠送总记录
export const getGiftRecord = (data: object) =>
  request('/user/giftPulseRecord', data, 'POST');

// 修改交易密码
export const editTradePwd = (data: object) =>
  request('/user/edit/payPassword', data, 'POST');

// 检查是否有交易密码
export const isCheckTradePwd = () =>
  request('/user/find/payPassword', {}, 'POST');

/**
 * 用户后结订单
 */

// 获取用户后结订单列表
export const getUserAfterOrderList = (data: object) =>
  request('/later/user/order', data, 'POST');

// 获取用户后结订单详情
export const getUserAfterOrderDetail = (data: object) =>
  request('/later/order/details', data, 'POST');
