import http from './index.js';

// 分页查询订单
export const pageOrder = (params) => http.get('/shop/order/page', {params})

// 查询订单列表
export const listOrder = (params) => http.get('/shop/order', {params})

// 查询订单列表
export const listByIds = (data) => http.post('/shop/order/listByIds', data)

// 查询订单
export const getOrder = (orderId) => http.get('/shop/order/' + orderId)

// 添加订单
export const addOrder = (data) => http.post('/shop/order', data)

// 添加订单
export const receiptOrder = (data) => http.post('/open/equipment/receipt', data)

// 删除订单
export const removeOrder = (id) => http.get('/open/order/remove/' + id)

export const setPayStatus = (data) => http.post('/shop/order/setPayStatus', data)

// 查询订单
export const getMyOrder = (params) => http.get('/open/order/getMyOrder', { params })

// 查询核销订单
export const getReceiptOrder = (params) => http.get('/open/order/getReceiptOrder', { params })

// 订单核销
export const updateOrder = (data) => http.post('/shop/order', data)

// 生成二维码
export const generateQrCode = (params) => http.get('/shop/order/generateQrCode', { params })

// 核销二维码码
export const verificationQrCode = (data) => http.put('/open/order/verification',data)

// 取消报餐
export const cancelOrder = (data) => http.post('/open/order/cancel', data)

// 查询代取餐人员的报餐信息
export const getOthersOrder = (params) => http.get('/apps/bc-food/getOthersFood', {params})

// 查询临时报餐订单
export const getTemporaryOrder = (params) => http.get('/apps/bc-food/getTemporaryOrder',{params})

export default {
	pageOrder,
	listOrder,
	listByIds,
	getOrder,
	addOrder,
	receiptOrder,
	removeOrder,
	setPayStatus,
	getMyOrder,
	verificationQrCode,
	cancelOrder,
	updateOrder,
	getOthersOrder,
	getReceiptOrder,
	getTemporaryOrder
}
