import request from '@/utils/request'

/**
 * 下单结算
 * @returns
 */
export function seckillOrderCalculate(params: Record<string, any>) {
    return request.post(`seckill/order/calculate`,params);
}

/**
 * 提交订单
 * @returns
 */
export function seckillOrderCreate(params: Record<string, any>) {
    return request.post(`seckill/order/create`,params);
}

/**
 * 获取订单详情
 */
export function getSeckillOrderDetail(order_id: any) {
    return request.get(`seckill/order/detail/${ order_id }`)
}

/**
 * 获取订单状态列表
 */
export function getSeckillOrderStatus() {
    return request.get(`seckill/order/status`)
}

/**
 * 获取订单列表
 */
export function getSeckillOrder(params: Record<string, any>) {
    return request.get(`seckill/order`, params)
}

/**
 * 关闭订单
 */
export function seckillOrderClose(params: Record<string, any>) {
    return request.post(`seckill/order/close`,params)
}

/**
 * 售后日志
 */
export function getSeckillRefundLog(params: Record<string, any>) {
    return request.get(`seckill/refund/log`,params)
}

/**
 * 退款原因
 */
export function getSeckillRefundReason() {
    return request.get(`seckill/refund/reason`)
}

/**
 * 申请退款
 */
export function applyRefund(params: Record<string, any>) {
    return request.post(`seckill/refund/apply`,params)
}

/**
 * 取消退款
 */
export function cancelRefund(params: Record<string, any>) {
    return request.post(`seckill/refund/cancel`,params)
}

/**
 * 获取退款列表
 */
export function getSeckillRefundList() {
    return request.get('seckill/order/refund')
}

/**
 * 会员订单统计
 */
export function getSeckillOrderStat() {
    return request.get('seckill/order/stat')
}
// 获取核销码
export function getSeckillGoodsVerifyCode(params: Record<string, any>) {
    return request.get('/verify', params)
}
// 获取条形码
export function getSeckillGoodsBarcode(params: Record<string, any>) {
    return request.get('/seckill/order/getBarCode', params)
}
//  获取记录
export function getSeckillGoodsVerifyRecords(params: Record<string, any>) {
    return request.get('/seckill/order/getVerifyRecords', params)
}