import { ajax } from '@/plugins/axios-plugin';
import { GO_URLS } from "@/config/URLS";
// 支付订单
export function pay(params: object) {
  return ajax({
    type: "post",
    url: GO_URLS.pay,
    params: params
  })
}
export function orderType(id: string) {
  return ajax({
    type: 'get',
    url: GO_URLS.orderType,
    params: {
      id: id
    }
  })
}
// 获取套餐列表
export function packageList() {
  return ajax({
    type: 'post',
    url: GO_URLS.packageList,
    params: {
      page: 1,
      page_size: 10
    }
  })
}
//  修改绑定手机号接口
export function editPhone(info: object) {
  return ajax({
    type: 'post',
    url: GO_URLS.setPhone,
    params: info
  })
}

// 原手机校验接口
export function checkOldPhone(info: object) {
  return ajax({
    type: 'post',
    url: GO_URLS.setPhoneCode,
    params: info
  })
}
export function sendEmail(info: object) {
  return ajax({
    type: "post",
    url: GO_URLS.sendEmail,
    params: info
  })
}
// 发送短信验证码
export function sendSms(info: object) {
  return ajax({
    type: "post",
    url: GO_URLS.sendSms,
    params: info
  })
}
// 修改密码接口
export function editPassword(info: object) {
  return ajax({
    type: 'post',
    url: GO_URLS.setPwd,
    params: info
  })
}
export function get(id: number) {
  return ajax({
    type: 'get',
    url: GO_URLS.get,
    params: {
      user_id: id
    }
  })
}

// // 个人认证接口
export function personVerify(info: object) {
  return ajax({
    type: 'post',
    url: GO_URLS.bankcard4c,
    params: info
  })
}
// // 短信验证码接口--个人认证
export function smsPerson(reservePhone: string) {
  return ajax({
    type: 'post',
    url: GO_URLS.sendSms,
    params: { phone: reservePhone, template_id: 2 }
  })
}
//  企业打款验证
export function companVerify(remitMoney: number) {
  return ajax({
    type: 'post',
    url: GO_URLS.bankNum,
    params: { num: remitMoney }
  })
}
// 获取用户信息
export function getUserInfo() {
  return ajax({
    type: "get",
    url: GO_URLS.user + `/` + JSON.parse(String(sessionStorage.getItem('user'))).id
  });
}

// // 企业基本信息录入
export function enterBaseInfo(info: object) {
  return ajax({
    type: 'post',
    url: GO_URLS.basic,
    params: info
  })
}

// // 企业银行卡信息录入
export function enterBank(info: object) {
  return ajax({
    type: 'post',
    url: GO_URLS.bank,
    params: info
  })
}

// // 企业认证状态
export function companyStatus(id: number) {
  return ajax({
    type: 'get',
    url: GO_URLS.info,
    params: {
      user_id: id
    }
  })
}

export function getMethods() {
  return ajax({
    type: 'get',
    url: GO_URLS.methods
  })
}