import request from '@/utils/request'

// 查询订单管理列表
export function listOrder(query) {
  return request({
    url: '/business/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单管理详细
export function getOrder(id) {
  return request({
    url: '/business/order/' + id,
    method: 'get'
  })
}

// 新增订单管理
export function addOrder(data) {
  return request({
    url: '/business/order',
    method: 'post',
    data: data
  })
}

// 修改订单管理
export function updateOrder(data) {
  return request({
    url: '/business/order',
    method: 'put',
    data: data
  })
}

export function orderLogsByOrderId(params) {
  return request({
    url: '/business/order/orderLogsByOrderId',
    method: 'get',
    params: params
  })
}

export function payOrder(data) {
  return request({
    url: '/business/order/pay',
    method: 'get',
    params: data
  })
}
export function receiveOrder(data) {
  return request({
    url: '/app/order/receive',
    method: 'get',
    params: data
  })
}

export function commitOrder(data) {
  return request({
    url: '/app/order/commit',
    method: 'get',
    params: data
  })
}


// 删除订单管理
export function delOrder(id) {
  return request({
    url: '/business/order/' + id,
    method: 'delete'
  })
}

// 删除订单管理
export function refund(data) {
  return request({
    url: '/business/order/refund',
    method: 'get',
    params: data
  })
}

export function orderSearch(params) {
  return request({
    url: '/business/order/search',
    method: 'get',
    params: params
  })
}
