import { request } from '@umijs/max';

export async function orderPage(bodys) {
    return request('/api/orders/page', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: bodys || {},
    });
}

export async function orderExport(body) {
    return request('/api/orders/export', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
        responseType: 'blob'
    });
}

export async function orderList(id) {
    return request(`/api/orders/orderIncomeList?id=${id}`, {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
    });
}

// 退单
export async function orderRefund(bodys) {
    return request('/api/orders/orderRefund', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: bodys || {},
    });
}

