import { http } from '@/utils/http'

const pre = import.meta.env.VITE_API_SECONDARY_URL_PREFIX

/**
 * 查询收益账户信息
 * @returns
 */
export function getAccountInfo() {
  return http.get<any>(`${pre}/account/api/getAccountInfo`)
}
/**
 * 查询钱包账户信息
 * @returns
 */
export function getWalletAccountInfo() {
  return http.get<any>(`${pre}/account/api/getWalletAccountInfo`)
}
/**
 * 钱包出入流水
 * @returns
 */
export function walletFlowList(data: any) {
  return http.post<any>(`${pre}/account/api/accountFlowList`, data)
}
/**
 * 查询收益记录
 * @returns
 */
export function envelopeList(data: any) {
  return http.post<any>(`${pre}/api/red/envelope/list`, data)
}
/**
 * 账户提现（钱包/收益账户）
 * @returns
 */
export function withdrawAdd(data: any) {
  return http.post<any>(`${pre}/api/withdraw/record/add`, data)
}
/**
 * 账户提现记录（钱包/收益账户）
 * @returns
 */
export function withdrawRecordList(data: any) {
  return http.post<any>(`${pre}/api/withdraw/record/list`, data)
}
/**
 * 冻结记录
 * @returns
 */
export function withdrawFreedList(data: any) {
  return http.get<any>(`${pre}/account/api/getFreeds`, data)
}
/**
 * 充值选项组
 * @returns
 */
export function rechargeGoodsList(data: any) {
  return http.get<any>(`${pre}/api/recharge/record/goodsList/${data.id}`)
}
/**
 * 充值方式
 * @returns
 */
export function paymentMethod() {
  return http.get<any>(`${pre}/app/payment/method/list`)
}
/**
 * 创建充值订单
 * @returns
 */
export function rechargeAdd(data: any) {
  return http.get<any>(`${pre}/api/recharge/record/add`, data)
}
/**
 * 充值回调
 * @returns
 */
export function rechargeCallback(data: any) {
  return http.get<any>(`${pre}/api/recharge/record/callback`, data)
}
/**
 * 充值记录
 * @returns
 */
export function rechargeRecordList(data: any) {
  return http.post<any>(`${pre}/api/recharge/record/list`, data)
}
/**
 * 排行榜type 1 7天收益排行
 * @returns
 */
export function redEnvelopeTop(data: any) {
  return http.get<any>(`${pre}/api/red/envelope/top`, data)
}

/**
 * 充值未完成订单查询
 * @returns
 */
export function unpaidOrder() {
  return http.get<any>(`${pre}/api/recharge/record/unpaidOrder`)
}

/**
 * 充值订单二次三方支付
 * @returns
 */
export function thirdPayAgree(recordId: any) {
  return http.get<any>(`${pre}/api/recharge/record/thirdPayAgree/${recordId}`)
}
