import http from '../utils/http'
let resquest = "/api/ihotel/hotelOrder"
let contentType = { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' }
//  获取请求令牌
export function hotelOrderToken(params) {
    return http.get(`${resquest}/user/submit/token`, params)
}

//  确认订单    
export function hotelOrderConfirm(params) {
    return http.get(`${resquest}/user/order/confirm`, params)
}

//  提交订单
export function hotelOrderSubmit(params) {
    return http.post(`${resquest}/user/order/submit`, params)
}

//  订单列表【用户端】  
export function hotelOrderUserPage(params) {
    return http.get(`${resquest}/user/order/page`, params)
}

//  订单列表【管理端】
export function hotelOrderAdminPage(params) {
    return http.get(`${resquest}/admin/order/page`, params)
}

//  订单详情 【用户端】
export function hotelOrderUserOrderId(orderId, params) {
    return http.get(`${resquest}/user/order/${orderId}`, params)
}

//   获取订单支付参数
export function hotelOrderOrderPay(orderId, params) {
    return http.get(`${resquest}/user/order/pay/${orderId}`, params)
}

//   获取订单支付参数
export function hotelOrderOrderBill(orderId, params) {
    return http.get(`${resquest}/user/order/bill/${orderId}`, params)
}




//  删除订单【管理端】
export function hotelOrderAdminDelete(orderId, params) {
    return http.delete(`${resquest}/admin/order/${orderId}`, params, contentType)
}

// 取消订单
export function hotelOrdercancel(orderId, params) {
    return http.put(`${resquest}/user/order/cancel/${orderId}`, params, contentType)
}

// 办理入住
export function hotelOrderHold(orderId, params) {
    return http.put(`${resquest}/user/order/hold/${orderId}`, params, contentType)
}

// 办理退房
export function hotelOrderReturn(orderId, params) {
    return http.put(`${resquest}/user/order/return/${orderId}`, params, contentType)
}

