import request from '@/utils/axios.js'

/**
  * @description 加入购物车
  */
export function cartCreateApi(data) {
  return request.post(`user/cart/create`, data)
}

/**
  * @description 购物列表
  */
export function cartListApi(data) {
  return request.get(`/order/cart/list`, { params: data })
}

/**
  * @description 编辑购物车数据
  */
export function cartChangeApi(id, data) {
  return request.post(`user/cart/change/${id}`, data)
}


/**
  * @description 结算
  */
export function orderCheckApi(data) {
  return request.post(`v2/order/check`, data)
}

/**
  * @description 删除商品
  */
export function cartDeleteApi(data) {
  return request.post(`user/cart/delete`, data)
}

/**
  * @description 支付
  */
export function orderCreateApi(data) {
  return request.post(`v2/order/create`, data)
}

/**
  * @description 重新支付
  */
export function orderPayApi(id, data) {
  return request.post(`order/pay/${id}`, data)
}

/**
  * @description 订单状态
  */
export function orderStatusApi(data) {
  return request.get(`micropay_query`, { params: data })
}

/**
  * @description 订单列表
  */
export function orderListApi(id, data) {
  return request.get(`admin/${id}/order_list`, { params: data })
}

/**
  * @description 核销订单列表
  */
export function verifierOrderListApi(id, code) {
  return request.get(`verifier/${id}/order/${code}`)
}

/**
  * @description 未支付订单列表
  */
export function groupOrderListApi(id, data) {
  return request.get(`admin/${id}/group_order_list`, { params: data })
}

/**
  * @description 提单
  */
export function orderLadingApi(data) {
  return request.get(`order_lading`, { params: data })
}

/**
  * @description 核销
  */
export function verifierApi(mer_id, id, data) {
  return request.post(`verifier/${mer_id}/${id}`, data)
}

/**
  * @description 统计
  */
export function statisticsApi(mer_id, data) {
  return request.get(`admin/${mer_id}/statistics`, { params: data })
}

/**
  * @description 统计列表
  */
export function orderPriceApi(mer_id, data) {
  return request.get(`admin/${mer_id}/order_price`, { params: data })
}


/**
  * @description 批发订单列表
  */
export function saleOrderListApi(mer_id, data) {
  return request.get(`order/list`, { params: data })
}