import request from "@/utils/request.js";

/**
 * 获取车辆列表
 * @param data object 
 */
export function getCarList(data) {
	return request.get(
		"v3/rent", data
	);
}
/**
 * 获取车辆详情
 * @param data object 
 */
export function getCarDetail(data) {
	return request.get(
		`v3/rent/${data.id}`
	);
}
/**
 * 创建订单
 * @param data object 
 */
export function postCarCreate(data) {
	return request.post(
		`v3/rent/create`, data
	);
}
/**
 * 订单状态查询
 * @param data object 
 */
export function getOrderStatus(id) {
	return request.get(
		`v3/rentinfo/detail/${id}`
	);
}
/**
 * 订单列表
 * @param data object 
 */
export function getRentOrder(data) {
	return request.get(
		`v3/rent/order`, data
	);
}

/**
 * 订单统计数据
 * @param data object 
 */
export function getRentOrderData(data) {
	return request.get(
		`v3/rent/order_data`, data
	);
}

/**
 * 订单详情
 * @param data object 
 */
export function getRentOrderDteail(id) {
	return request.get(
		`v3/rent/order_detail/${id}`
	);
}
/**
 * 订单支付
 * @param data object 
 */
export function postRentPay(data) {
	return request.post(
		`v3/rent/pay`, data
	);
}
/**
 * 绑定车辆
 * @param data object 
 */
export function rentSetcar(data) {
	return request.post(
		`v3/rent/setcar`, data
	);
}

/**
 * 获取我的车辆
 * @param data object 
 * {
 *	status：unlock开锁，lock关锁，deblock解锁，cushion开坐垫，find寻车
 *}
 */
export function getMyCar(data) {
	return request.get(
		`v3/car/my`, data
	);
}

/**
 * 发送车辆指令
 * @param data object 
 */
export function getLock(data) {
	return request.get(
		`v3/car/control/${data.type}`, data
	);
}



/**
 * 车辆控制记录
 * @param data object 
 * {
	 type:auth授权record行程notice报警record_charge收费position当前车辆信息
 }
 * 
 */
export function getOneinfo(data) {
	return request.get(
		`v3/car/oneinfo/${data.type}`, data
	);
}
/**
 * 车辆行车记录
 * @param data object 
 */
export function getRouterDetail(data) {
	return request.get(
		`v3/car/onedetail/${data.type}`, data
	);
}
/**
 * 车辆授权
 * @param data object 
 */
export function postCarAuth(data) {
	return request.post(
		`v3/car/auth/0`, data
	);
}

/**
 * 撤销车辆授权
 * @param data object 
 */
export function deleteCarAuth(data) {
	return request.delete(
		`v3/car/auth/${data.id}`, data
	);
}

