import { useRequest } from '@/use/useHttp'
import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant'

export const MpEnumSaleOrderStatus = () => {
  return useRequest({
    url: '/v2/mp/enum/filterMPSaleOrderStatus',
    method: 'get',
  })
}

/**
 * 获取订单列表
 * @returns
 */
export const OrderListApi = () => {
  return useRequest({
    url: '/v2/mp/saleOrder/list',
    method: 'get',
  })
}

/**
 *  客户列表
 * @returns
 */
export const ClientListApi = () => {
  return useRequest({
    url: '/v2/mp/purchaser/list',
    method: 'get',
  })
}
// 面料种类列表
export const MpProductColorList = () => {
  return useRequest({
    url: '/v2/mp/product/color/list',
    method: 'get',
  })
}
// 购物车提交
export const MpSaleOrderPreview = () => {
  return useRequest({
    url: '/v2/mp/saleOrder/preView',
    method: 'put',
  })
}
// 业务员枚举
export const MpEnumSaleUserList = () => {
  return useRequest({
    url: '/v2/mp/enum/saleUser/list',
    method: 'get',
  })
}
// 订单详情
export const MpSaleOrder = () => {
  return useRequest({
    url: '/v2/mp/saleOrder',
    method: 'get',
  })
}
// 取消订单
export const MpSaleOrderCancel = () => {
  return useRequest({
    url: '/v2/mp/saleOrder/cancel',
    method: 'put',
  })
}
// 再次购买
export const MpShoppingCartProductColorList = () => {
  return useRequest({
    url: '/v2/mp/shoppingCart/productColor/list',
    method: 'post',
  })
}
// 获取账期付款
export const OrderPaymentOrderPaymentMethodInfo = () => {
  return useRequest({
    url: '/v2/mp/orderPayment/orderPaymentMethodInfo',
    method: 'get',
  })
}
// 预收单获取接口信息
export const OrderPaymentPreCollectOrderOrderPaymentMethodInfo = () => {
  return useRequest({
    url: '/v2/mp/orderPayment/preCollectOrder/orderPaymentMethodInfo',
    method: 'get',
  })
}
// 确认交易
export const OrderPaymentOrderPaymentSubmission = () => {
  return useRequest({
    url: '/v2/mp/orderPayment/orderPaymentSubmission',
    method: 'put',
  })
}
// 订单预支付提交
export const OrderPaymentPreCollectOrderOrderPaymentSubmission = () => {
  return useRequest({
    url: '/v2/mp/orderPayment/preCollectOrder/orderPaymentSubmission',
    method: 'put',
  })
}
/**
 * 获取在线支付二维码
 */
export const GetPayCode = () => {
  return useRequest({
    url: '/xima-caphtml/caphtml',
    base_url: CAP_HTML_TO_IMAGE_BASE_URL,
    method: 'post',
  })
}
/**
 * 获取退款码单
 */
export const GetReturnPayCode = () => {
  return useRequest({
    url: '/xima-caphtml/caphtml-return',
    base_url: CAP_HTML_TO_IMAGE_BASE_URL,
    method: 'post',
  })
}
// 编辑备注信息
export const MpSaleOrderPut = () => {
  return useRequest({
    url: '/v2/mp/saleOrder',
    method: 'put',
  })
}
// 修改销售单的收货地址
export const MpSaleOrderAddress = () => {
  return useRequest({
    url: '/v2/mp/saleOrder/address',
    method: 'put',
  })
}
// 关键字搜索历史
export const MpSearchHistoryList = () => {
  return useRequest({
    url: '/v2/mp/searchHistory/list',
    method: 'get',
  })
}
// 添加关键字搜索
export const MpSearchHistory = () => {
  return useRequest({
    url: '/v2/mp/searchHistory',
    method: 'post',
  })
}
// 确认收货
export const MpSaleOrderReceive = () => {
  return useRequest({
    url: '/v2/mp/saleOrder/receive',
    method: 'put',
  })
}
// 退货原因
export const MpEnumReturnOrderReturnReason = () => {
  return useRequest({
    url: '/v2/mp/enum/returnOrder/returnReason',
    method: 'get',
  })
}
// 二次选择退货原因
export const MpEnumReturnExplain = () => {
  return useRequest({
    url: '/v2/mp/enum/returnExplain',
    method: 'get',
  })
}
// 货物状况
export const MpEnumReturnGoodsStatus = () => {
  return useRequest({
    url: '/v2/mp/enum/return/goodsStatus',
    method: 'get',
  })
}
// 申请退货
export const MpReturnApplyOrder = () => {
  return useRequest({
    url: '/v2/mp/returnApplyOrder',
    method: 'put',
  })
}
// 退款说明
export const MpEnumRefundExplainOne = () => {
  return useRequest({
    url: '/v2/mp/enum/refundExplain',
    method: 'get',
  })
}

// 提交订单
export const MpSaleOrderPost = () => {
  return useRequest({
    url: '/v2/mp/saleOrder',
    method: 'post',
  })
}
// 修改销售单物流方式
export const MpSaleOrderShipmentMode = () => {
  return useRequest({
    url: '/v2/mp/saleOrder/shipmentMode',
    method: 'put',
  })
}
// 修改销售单物流方式
export const EnumPurchaserType = () => {
  return useRequest({
    url: '/v2/mp/enum/purchaserType',
    method: 'get',
  })
}
