import request from '@/utils/request'

// 查询充值订单列表
export function listOrder(query) {
  return request({
    url: '/mapi/recharge/order/list',
    method: 'get',
    params: query
  })
}

// 查询充值订单详细
export function getOrder(id) {
  return request({
    url: '/mapi/recharge/order/' + id,
    method: 'get'
  })
}

// 新增充值订单
export function addOrder(data) {
  return request({
    url: '/mapi/recharge/order',
    method: 'post',
    data: data
  })
}


// 新增充值订单
export function morePay(data) {
  return request({
    url: '/mapi/recharge/order/morePay',
    method: 'post',
    data: data
  })
}


// 修改充值订单
export function updateOrder(data) {
  return request({
    url: '/mapi/recharge/order',
    method: 'put',
    data: data
  })
}

// 删除充值订单
export function delOrder(id) {
  return request({
    url: '/mapi/recharge/order/' + id,
    method: 'delete'
  })
}


// 修改充值订单状态
export function updateOrderStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/recharge/order/updateStatus',
    method: 'post',
    data: data
  })
}

export function getPayDetailById(id) {
  return request({
    url: '/mapi/recharge/order/getPayDetailById',
    method: 'get',
    params: {id: id}
  })
}

export function getRechargeRecordByUserId(id) {
  return request({
    url: '/mapi/recharge/order/getRechargeRecordByUserId',
    method: 'get',
    params: {userId: id}
  })
}
export function getOrderStatusByOrderNo(data) {
  return request({
    // url: '/mapi/recharge/order/getOrderStatusByOrderNo',
    // url: '/mapi/order/cloth/getOrderPayResult',
    url: '/mapi/recharge/order/getOrderPayResult',
    method: 'get',
    params: data
  })
}

export function getOrderIsAllPayByOrderNo(data) {
  return request({
    url: '/mapi/recharge/order/getOrderIsAllPayByOrderNo',
    method: 'get',
    params: data
  })
}
