import { useRequest } from '@/use/useHttp'

/**
 * 下单现货销售单
 */
export const SaleOrderApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder',
    method: 'post',
  })
}

/**
 * 预览销售单
 */
export const SaleOrderPreViewApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/preView',
    method: 'put',
  })
}

/**
 * 获取商城订单详情
 */
export const GetSaleOrderDetailApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/detail',
    method: 'get',
  })
}

/**
 * 修改销售单备注
 */
export const EditSaleOrderRemarkApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/remark',
    method: 'put',
  })
}

/**
 * 修改销售单地址
 */
export const EditSaleOrderAddressApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/address',
    method: 'put',
  })
}

/**
 * 修改销售单收货方法
 */
export const EditSaleOrderShipmentModeApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/shipmentMode',
    method: 'put',
  })
}

/**
 * 获取订单状态枚举
 */
export const GetOrderStatusListApi = () => {
  return useRequest({
    url: '/v1/mall/enum/sale/order/status',
    method: 'get',
  })
}

/**
 * 获取订单列表
 */
export const GetOrderListApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/list',
    method: 'get',
  })
}

/**
 * 作废销售单
 */
export const CancelOrderApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/cancel',
    method: 'put',
  })
}

/**
 * 确认收货
 */
export const ReceiveOrderApi = () => {
  return useRequest({
    url: '/v1/mall/saleOrder/receive',
    method: 'put',
  })
}

/**
 * 订单状态列表
 */
export const OrderStatusListApi = () => {
  return useRequest({
    url: '/v1/mall/enum/filterSaleOrderStatus',
    method: 'get',
  })
}
