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

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

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

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

/**
  * @description 下单前校验数量库存
  */
export function storeOrdeCheckInventoryrApi(data) {
    return request.post(`/store_order/storeOrder/checkInventory`, data)
}

/**
  * @description 结算
  */
export function orderCheckApi(data) {
    return request.post(`/store_order/StoreOrder/checkOrder`, data)
}

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

/**
  * @description 支付
  */
export function orderCreateApi(data) {
    return request.post(`/store_order/StoreOrder/createOrder`, data)
}


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

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

/**
  * @description 订单列表
  */
export function orderListApi(data) {
    return request.get(`/order/retailOrder/merchant_order_list`, { params: data })
}

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

/**
  * @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(store_id, id, data) {
    return request.post(`verifier/${store_id}/${id}`, data)
}

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

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


/**
  * @description 收银订单列表
  */
export function saleOrderListApi(data) {
    return request.get(`/store_order/StoreOrder/lists`, { params: data })
}

/**
  * @description 预约订单列表
  */
export function userProductStorageListApi(data) {
    return request.get(`/user_product_storage_log/UserProductStorageLog/lists`, { params: data })
}

/**
  * @description 采购订单提交
  */
export function createOrderApi(data) {
    return request.post(`/order/OpurchaseOrder/createOrder`, { params: data })
}

/**
  * @description 订单商品列表
  */
export function cashierinfoListApi(data) {
    return request.get(`/order/cashierinfo/lists`, { params: data })
}

/**
  * @description 订单详情
  */
export function cashierinfoDetailsApi(data) {
    return request.get(`/store_order/storeOrder/detail`, { params: data })
}

/**
  * @description 核销记录
  */
export function cashierinfoWriteoffListApi(data) {
    return request.get(`/store_order/storeOrder/writeoff_list`, { params: data })
}

/**
* @description 订单核销
*/
export function writeoffOrderApi(data) {
    return request.post(`/store_order/StoreOrder/writeoff_order`, data)
}

/**
  * @description 商户给用户添加地址
  */
export function merchantCreateApi(data) {
    return request.post(`/user/address/merchant_create`, data)
}

/**
  * @description 采购订单记录列表
  */
export function opurchaseOrderApi(data) {
    return request.get(`/order/OpurchaseOrder/lists`, { params: data })
}

/**
  * @description 采购订单子订单列表
  */
export function subOrdersListApi(data) {
    return request.get(`/order/OpurchaseOrder/sub_orders`, { params: data })
}

/**
  * @description 摊贩订单数量统计
  */
export function merchantOrderCountApi(data) {
    return request.get(`/order/retailOrder/merchant_order_count`, { params: data })
}

/**
  * @description 发送短信验证(采购款)
  */
export function storeOrderCheckSmsApi(data) {
    return request.post(`/store_order/StoreOrder/checkSms`, data)
}

/**
  * @description 订单打印
  */
export function storeOrderPrintApi(data) {
    return request.get(`/store_order/StoreOrder/print`, { params: data })
}

/**
  * @description 用户商品存储列表
  */
export function userProductStorageApi(data) {
    return request.get(`/user_product_storage/UserProductStorage/lists`, { params: data })
}


/**
  * @description 用户商品存储出库
  */
export function userProductStorageSupplyApi(data) {
    return request.post(`/user_product_storage/UserProductStorage/supply`, data)
}
