import request from '@/utils/request'

// 订单初始化
export const apiInitOrder = (params: any) => request.get({ url: '/order/init', data: params })

// 订单下单
export const apiPlaceOrder = (params: any) => request.post({ url: '/order/add', data: params })

// 订单列表
export const apiOrderLists = (params: any) =>
    request.get({ url: '/order/list', data: params }, { ignoreCancel: true })

// 订单详情
export const apiOrderDetail = (params: any) => request.get({ url: '/order/detail', data: params })

// 取消订单
export const apiOrderCancel = (params: any) => request.post({ url: '/order/cancel', data: params })

// 删除订单
export const apiOrderDel = (params: any) => request.get({ url: '/order/del', data: params })

// 关闭订单（取消支付）
export const apiOrderClose = (params: any) =>
    request.post({ url: '/pay/wx/closeOrder', data: params })

/** 师傅订单服务 Start **/

// 师傅服务列表
export const apiStaffOrderLists = (params: any) =>
    request.get({ url: '/order/staff/list', data: params }, { ignoreCancel: true })

// 师傅服务详情
export const apiStaffOrderDetail = (params: any) =>
    request.get({ url: '/order/detail', data: params })

// 确认服务
export const apiStaffOrderConfirmService = (params: any) =>
    request.get({ url: '/order/staff/confirm', data: params })

// 核销订单
export const apiStaffOrderVerification = (params: any) =>
    request.get({ url: '/order/staff/verification', data: params })

/** 师傅订单服务 Start **/
