// 引入 request 文件
import request from './request.js'

//公寓整体配置
export const apartSet = (params) => {
    return request({
        url: '/apartment-setting/appletList',
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
//查看公寓设施
export const gongyusheshi = (params) => {
    return request({
        url: '/facility-services/appletList',
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
// 房型接口
export const getroomtype = (params) => {
    return request({
        url: '/house/appletList'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
// 房型详情接口
export const getroomtypeinfo = (params) => {
    return request({
        url: '/house/appletParticulars'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
// 订单列表
export const getorderpage = (params) => {
    return request({
        url: '/house-order/orderPage'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 获取支付openId
export const getpayOpenId = (params) => {
    return request({
        url: '/house-order/getPayOpenId'+params,
        method: 'post',
		// data:params,
		header:{
		}
    })
}
// 支付订单
export const getorderpay = (params) => {
    return request({
        url: `/house-order/pay`,
        method: 'post',
		data:params,
		header:{
			'token':localStorage.getItem('token'),
			'openId' :localStorage.getItem('openId2')
		}
    })
}
// 查询支付订单
export const getchapay = (params) => {
    return request({
        url: `/house-order/queryOrderById`,
        method: 'post',
		data:params,
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 办理退房
export const getorderreturn = (params) => {
    return request({
        url: `/house-order/checkOutApplet`,
        method: 'post',
		data:params,
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 办理入住
export const getorderhold = (params) => {
    return request({
        url: '/house-order/checkIn'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 删除订单
export const getorderdelete = (params) => {
    return request({
        url: `/ihotel/hotelOrder/user/order/${params}`,
        method: 'delete',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 待支付取消订单
export const getordercancel = (params) => {
    return request({
        url: `/ihotel/hotelOrder/user/order/cancel/${params}`,
        method: 'put',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 获取用户信息
export const getuserinfo = (params) => {
    return request({
        url: '/users/getUser'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 订单结账信息
export const getorderbill = (params) => {
    return request({
        url: `/ihotel/hotelOrder/user/order/bill/${params}`,
        method: 'get',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 获取请求令牌
export const getsubmittoken = (params) => {
    return request({
        url: `/ihotel/hotelOrder/user/submit/token`,
        method: 'get',
		header:{
			'token':localStorage.getItem('token')
		}
    })
}
// 每晚金额详情
export const getMeiprice = (params) => {
    return request({
        url: '/house-price/housePriceOrder'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
//计算订单金额
export const getprice = (params) => {
    return request({
        url: '/house-order/houseOrderPrice'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
//获取钟点房可住时间段
export const getZhongTime = (params) => {
    return request({
        url: '/house-order/appletReserveHour'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
// 订单详情
export const getorderdetail = (params) => {
    return request({
        url: '/house-order/getHouseOrder'+params,
        method: 'get',
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
//创建订单
export const postOrder = (params,header) => {
    return request({
        url: `/house-order/establishOrder`,
        method: 'post',
		data:params,
		header:header
    })
}
//取消订单
export const quxiaoorder = (params,header) => {
    return request({
        url: `/house-order/cancelApplet`,
        method: 'post',
		data:params,
		header:{
			'token':localStorage.getItem('token'),
			'user_head':localStorage.getItem('user_head'),
		}
    })
}
//临时人员提交审核
export const postLingshi = (params,header) => {
    return request({
        url: `/application-procedure-temporary/save`,
        method: 'post',
		data:params,
		header:header
    })
}
//教师提交审核
export const postTeacher = (params,header) => {
    return request({
        url: `/application-procedure/save`,
        method: 'post',
		data:params,
		header:header
    })
}
//查看是否能预订，能选的流程列表
export const ifyuding = (params,header) => {
    return request({
        url: '/house-order/remainFree'+params,
        method: 'get',
		header:header
    })
}
//获取换课老师下拉框
export const getChange = (params,header) => {
    return request({
        url: '/application-procedure/changeDropDown',
        method: 'get',
		data:params,
		header:header
    })
}
//审批规则
export const shenpiguiju = (params,header) => {
    return request({
        url: '/application-procedure-setting/get',
        method: 'get',
		header:header
    })
}
//管理员查看临时人员记录
export const getManaLinlist = (params,header) => {
    return request({
        url: '/application-procedure-temporary/appletList'+params,
        method: 'get',
		header:header
    })
}
//管理员查看教师换课记录
export const getManaTealist = (params,header) => {
    return request({
        url: '/application-procedure/appletList'+params,
        method: 'get',
		header:header
    })
}
//审批临时人员
export const shenpiLinshi = (params,header) => {
    return request({
        url: '/application-procedure-temporary/appletUpdate',
        method: 'post',
		data:params,
		header:header
    })
}
//审批教师换课
export const shenpiTeacher = (params,header) => {
    return request({
        url: '/application-procedure/appletUpdate',
        method: 'post',
		data:params,
		header:header
    })
}
//提交记录
export const getOtherlist = (params,header) => {
    return request({
        url: '/application-procedure/appletRecordList'+params,
        method: 'get',
		header:header
    })
}
//提交记录详情
export const getlistXiang = (params,header) => {
    return request({
        url: '/application-procedure/appletDetail'+params,
        method: 'get',
		header:header
    })
}

