import request from '@/utils/request'

// 查询订单主列表
// export function listOrder(data) {
//   return request({
//     url: '/system/order/list',
//     method: 'post',
//     data: data
//   })
// }
// 查询订单主列表
export function listOrder(params) {
    return request({
      url: '/system/order/list',
      method: 'get',
      params
    })
  }

// 查询订单主详细
export function getOrder(orderId) {
  return request({
    url: '/system/order/' + orderId,
    method: 'get'
  })
}

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

// 修改订单主
export function updateOrder(data) {
  return request({
    url: '/system/order',
    method: 'put',
    data: data
  })
}
//校验修改订单主
export function editVerify(query) {
  return request({
    url: '/system/order/editVerify',
    method: 'get',
    params: query
  })
}

// 删除订单主
export function delOrder(orderId) {
  return request({
    url: '/system/order/' + orderId,
    method: 'delete'
  })
}

// 导出订单主
export function exportOrder(query) {
  return request({
    url: '/system/order/export',
    method: 'get',
    params: query
  })
}

// 修改单价
export function modifyPrice(data) {
  return request({
    url: '/system/order/modifyPrice',
    method: 'put',
    data: data
  })
}

export function getAddress(orderId) {
  return request({
    url: '/system/order/getAddressInfo/' + orderId,
    method: 'get'
  })
}

// 根据核销码查询订单信息
export function getOrderByVerificationCode(orderVerificationCode) {
    return request({
      url: '/system/order/getOrderByVerificationCode/' + orderVerificationCode,
      method: 'get'
    })
  }

// 查询团购服务订单列表
export function listGroupOrder(params) {
    return request({
      url: '/system/order/listGroupOrder',
      method: 'get',
      params
    })
  }