import request from '../util/request'

export const getCode = data => request({
  url: '/sendSmsCode',
  method: 'post',
  data
})

export const login = data => request({
  url: '/smsNumber',
  method: 'post',
  data
})

export const postBuy = data => request({
  url: '/handle',
  method: 'post',
  data
})

export const postUnBuy = data => request({
  url: '/handle',
  method: 'post',
  data
})

export const memberList = data => request({
  url: '/queryFiveVip',
  method: 'post',
  data
})

export const memberGive = data => request({
  url: '/joinActivity',
  method: 'post',
  data
})

export const orderList = data => request({
  url: '/qrybusi',
  method: 'post',
  data,
  loading: true
})

export const memberGet = data => request({
  url: '/joinActivity',
  method: 'post',
  data
})

export const strategyGet = data => request({
  url: '/queryStrategyInfo',
  method: 'post',
  data
})

export const postFeed = data => request({
  url: '/submitFeedback',
  method: 'post',
  data
})

export const qryMappid = data => request({
  url: '/qrymappid',
  method: 'post',
  data
})

export const qryUserid = data => request({
  url: '/qryuserid',
  method: 'post',
  data
})

export const addRecord = data => request({
  url: '/addRecord',
  method: 'post',
  data,
  loading: true
})
export const searchResult = data => request({
  url: '/queryCapOrder',
  method: 'post',
  data
})

export const changeUserid = data => request({
  url: '/changeUserid',
  method: 'post',
  data
})

export const changeBackUserid = data => request({
  url: '/changeBackUserid',
  method: 'post',
  data
})

export const changeUseridToPhone = data => request({
  url: '/changeUseridToPhone',
  method: 'post',
  data,
  loading: true
})

export const changeBsiteUserid = data => request({
  url: '/changeBsiteUserid',
  method: 'post',
  data
})

export const changeUseridToBsite = data => request({
  url: '/changeUseridToBsite',
  method: 'post',
  data,
  loading: true
})

export const detMainProduct = data => request({
  url: '/queryProductInfo',
  method: 'post',
  data
})

// 订购页userid转活动页userid
export const useridFromUoToAo = data => request({
  url: '/useridFromUoToAo',
  method: 'post',
  data
})

// 活动页userid转订购页userid
export const useridFromAoToUo = data => request({
  url: '/useridFromAoToUo',
  method: 'post',
  data
})

// 通过channelKEY获取渠道信息
export const channelGet = data => request({
  url: '/detailByKey',
  method: 'get',
  params: data
})

//通过channelKey获取策略信息
export const strategyGetNew = (data, loading) => request({
  url: '/queryStrategyInfoNew',
  method: 'post',
  data,
  loading: loading
})

//通过id获取策略信息
export const strategyGetID = (data, loading) => request({
  url: '/queryStrategyInfobyId',
  method: 'post',
  data,
  loading: loading
})
//获取手机号归属地
// export const getPhoneAddres = (data) => request({
//   url: '/getphoneinfo?userId=' + encodeURIComponent(data.userId),
//   method: 'post',
//   data,
// })
//
export const getPhoneAddres = (data) => request({
  url: '/getphoneinfo',
  method: 'post',
  data,
})

export const getstrategyglobal = data => request({
  url: '/getstrategyglobal',
  method: 'get',
  params: data
})
// 切换会员权益
export const setmultivip = data => request({
  url: '/setmultivip',
  method: 'post',
  data
})
// 高级策略匹配
export const seniorStrategy = data => request({
  url: '/matchstrategypro',
  method: 'post',
  data,
})

// (新)短信验证码发送接口
export const getNewCode = data => request({
  url: '/sendCapSmsCode',
  method: 'post',
  data
})

//短信验证码验证及订购接口
export const postNewBuy = data => request({
  url: '/checkCapSmsCode',
  method: 'post',
  data
})

//推送订购关系数据
export const postOrdersync = data => request({
  url: '/ordersync',
  method: 'post',
  data
})

//短验用户信息回传接口
export const postInformationReturn = data => request({
  url: '/vascap/informationReturn/v1',
  method: 'post',
  data
})

// 订购成功超时  字节回传api
export const postByte = data => request({
  url: '/eventmgr',
  method: 'post',
  data,
  loading: true
})

// 字节星图回传Api
export const byteApi = data => request({
  url: '/trackback',
  method: 'post',
  data
})


// 爱奇艺免登
export const aqyUser = data => request({
  url: '/aiqiyiDecrypt',
  method: 'post',
  data
})

// 号段查询
export const numberSearch = data => request({
  url: '/number_segment/info',
  method: 'get',
  params: data
})

export const outFeed = data => request({
  url: '/helprecord',
  method: 'post',
  data
})

// 测试ftp
export const sftpGet = data => request({
  url: '/ftp',
  method: 'get',
  params: data
})

// 获取新策略模板信息
export const strategytemplate = id => request({
  url: '/strategytemplate/' + id,
  method: 'post'
})

//新版策略匹配 高级+基础 /h5/matchstrategy/
export const newStrategy = data => request({
  url: '/matchstrategy/',
  method: 'post',
  data
})