import api from "../api/api";
import { $request } from "../utils/request";

/**
 * 获取我的订单列表
 * @param data 
 */
export const getOrdersApi = (data: getOrdersDataType): Promise<responseOptions> => {
	const options: requestOptionsType<any> = {
		url: api.hwOrder.getOrders,
		data
	};
	return $request(options);
};

/**
 * 确认订单
 * @param data 
 */
export const confirmOrderApi = (data: confirmOrderDatatype): Promise<responseOptions> => {
	const options: requestOptionsType<any> = {
		url: api.hwOrder.confirmOrder,
		data,
		type: 'post'
	}
	return $request(options);
}

/**
 * 确认订单
 * @param data 
 */
export const confirmECOrdersApi = (data: confirmOrderDatatype): Promise<responseOptions> => {
	const options: requestOptionsType<any> = {
		url: api.hwOrder.confirmECOrders,
		data,
		type: 'post'
	}
	return $request(options);
}

/**
 * 获取订单详情
 * @param data 
 */
export const getOrderDetailApi = (data: getOrderDetailDataType): Promise<responseOptions> => {
	const options: requestOptionsType<any> = {
		url: api.hwOrder.getOrderDetail,
		data,
	}
	return $request(options)
}