import request from '@/common/axiosHelper.js'
/* 登录 */
export function login (data) {
  return request({
    url: '/Meter/LoginOwner',
    method: 'POST',
    data
  })
}

/* 发送手机验证码 */
export function sendSms (phone) {
  return request({
    url: '/Meter/SendSms',
    method: 'get',
    params: {phone}
  })
}

/* 获取欠费信息 */
// eslint-disable-next-line camelcase
export function Getfdc_pm_unfare (phone) {
  return request({
    url: '/Meter/Getfdc_pm_unfare',
    method: 'get',
    params: {phone}
  })
}

/* 获取缴费记录 */
// eslint-disable-next-line camelcase
export function Getfdc_pm_revfare (phone) {
  return request({
    url: '/Meter/Getfdc_pm_revfare',
    method: 'get',
    params: {phone}
  })
}

/* 获取房产信息 */
export function GetOwnerHouse (phone) {
  return request({
    url: '/Meter/GetOwnerHouse',
    method: 'get',
    params: {phone}
  })
}

/* 获取报修记录 */
export function GetRepaireList (phone) {
  return request({
    url: '/Meter/GetRepaireList',
    method: 'get',
    params: {phone}
  })
}
/* 获取投诉记录 */
export function GetComplaintList (phone) {
  return request({
    url: '/Meter/GetComplaintList',
    method: 'get',
    params: {phone}
  })
}
/* 获取车辆信息 */
export function GetvehicleList (phone) {
  return request({
    url: '/Meter/GetvehicleList',
    method: 'get',
    params: {phone}
  })
}
/* 插入车辆信息 */
// eslint-disable-next-line camelcase
export function Insertfdc_pm_vehicle (data) {
  return request({
    url: '/Meter/Insertfdc_pm_vehicle',
    method: 'post',
    data
  })
}
/* 删除车辆信息 */
// eslint-disable-next-line camelcase
export function Deletefdc_pm_vehicle (data) {
  return request({
    url: '/Meter/Deletefdc_pm_vehicle',
    method: 'post',
    data
  })
}
/* 我要报修 */
// eslint-disable-next-line camelcase
export function Insertfdc_pm_repair (data) {
  return request({
    url: '/Meter/Insertfdc_pm_repair',
    method: 'post',
    data
  })
}
/* 我要投诉 */
// eslint-disable-next-line camelcase
export function Insertfdc_pm_repairByTousu (data) {
  return request({
    url: '/Meter/Insertfdc_pm_repairByTousu',
    method: 'post',
    data
  })
}
/* 报修详情 */
export function GetRepairDetail (code) {
  return request({
    url: '/Meter/GetRepairDetail',
    method: 'get',
    params: {code}
  })
}

/* 绑定房屋信息 */
export function BindHouse (phone) {
  return request({
    url: '/Meter/BindHouse',
    method: 'get',
    params: {phone}
  })
}

/* 获取JSAPI支付数据 */
export function GetJSAPIWxPayData (data) {
  return request({
    url: '/Meter/GetJSAPIWxPayData',
    method: 'post',
    data
  })
}

/* 生成微信支付二维码 */
export function MakePayQrCode (data) {
  return request({
    url: '/Meter/MakePayQrCode',
    method: 'post',
    data
  })
}

/* 登出 */
export function logout (userid) {
  return request({
    url: '/user/logout',
    method: 'get',
    params: { userid }
  })
}

/* 获取openid */
export function getOpenId (code) {
  return request({
    url: '/Meter/getOpenId',
    method: 'get',
    params: { code }
  })
}

/* 插入缴费记录 */
export function InsertPay (data) {
  return request({
    url: '/Meter/InsertPay',
    method: 'post',
    data
  })
}

/* 关闭订单 */
// eslint-disable-next-line camelcase
export function CloseOrder (out_trade_no) {
  return request({
    url: '/Meter/CloseOrder',
    method: 'get',
    params: {out_trade_no}
  })
}
