import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant'
import { useRequest } from '@/use/useHttp'
/**
 * 解密用户微信信息
 */
export const GetWxUserInfoApi = () => {
  return useRequest({
    url: '/v1/mall/user/decrypt',
    method: 'post',
  })
}

/**
 * 获取后台返回的用户信息
 */
export const GetAdminUserInfoApi = () => {
  return useRequest({
    url: '/v1/mall/user/info',
    method: 'get',
  })
}

/**
 * 获取后台返回的用户手机号码信息
 */
export const GetPhoneNumberApi = () => {
  return useRequest({
    url: '/v1/mall/user/phoneNumber',
    method: 'post',
  })
}

/**
 * 修改用户昵称
 */
export const realNameUpdateApi = () => {
  return useRequest({
    url: '/v1/mall/user',
    method: 'put',
  })
}

/**
 * 公司类型|企业类型 下拉列表
 */
export const companyTypeApi = () => {
  return useRequest({
    url: '/v1/mall/enum/purchaserType',
    method: 'get',
  })
}

/**
 * 头像更改
 */
export const portraitUpdateApi = () => {
  return useRequest({
    url: '/v1/mall/user/avatar',
    method: 'put',
  })
}

/**
 * 绑定公司
 */
export const BindingCompanyApi = () => {
  return useRequest({
    url: '/v1/mall/user/binding/company',
    method: 'put',
  })
}

/**
 * 申请下单权限
 */
export const ApplyOrderAccessApi = () => {
  return useRequest({
    url: '/v1/mall/orderAccess/apply',
    method: 'post',
  })
}

/**
 * 订阅模板id
 */
export const SubscriptionMessageApi = () => {
  return useRequest({
    url: '/v1/mall/subscriptionMessage',
    method: 'get',
  })
}

/**
 * 邀请码获取业务员信息
 */
export const GetInvitationInfoApi = () => {
  return useRequest({
    url: '/v1/mall/user/invitationInfo',
    method: 'get',
  })
}

/**
 * 绑定业务员
 */
export const BindInvitationInfoApi = () => {
  return useRequest({
    url: '/v1/mall/user/bindInvitationCode',
    method: 'post',
  })
}
// 生成二维码
export const GenBarCodeOrQrCode = () => {
  return useRequest({
    url: '/xima-caphtml/genBarcodeOrQrCode',
    base_url: CAP_HTML_TO_IMAGE_BASE_URL,
    method: 'post',
  })
}
// 获取邀请码列表
export const GetInviteCodeList = () => {
  return useRequest({
    url: '/v2/mall/user/inviterList',
    method: 'get',
    pagination: true,
  })
}
// 邀请码
export const GetInvitationInfo = () => {
  return useRequest({
    url: '/v2/mall/user/invitationInfoRecord',
    method: 'get',
  })
}
// 邀请码
export const GetInviteeRecord = () => {
  return useRequest({
    url: '/v2/mall/user/invitee_record',
    method: 'get',
  })
}
