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 getOrder = (orderId) => http.get('/shop/order/' + orderId)
export const getOrderPay = (id) => http.get('/shop/order-pay/' + id)
export const getOrderPayByOrderId = (orderId) => http.get('/shop/order-pay/getByOrderId/' + orderId)
export const getOrderPayList = (params) => http.get('/shop/order-pay/', {params})

// 添加订单
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 freeze = (data) => http.get('/shop/order/freeze', {})
export const checkFreeze = (orderId) => http.post('/shop/freeze-order/checkFreeze/' + orderId, {})

export default {
	pageOrder,
	listOrder,
	getOrder,
	addOrder,
	receiptOrder,
	removeOrder,
	setPayStatus,
	freeze,
	checkFreeze,
	getOrderPay,
	getOrderPayByOrderId,
	getOrderPayList
}
