import { axios } from '@/utils/request'

// 获取骑手列表数据
export const getRiderList = params => {
  const url = `/userExt/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}

// 改变权限状态接口
export const updateEnableStatus = params => {
  return axios({
    url: `userExt/enable/${params.id}/${params.flag}`,
    data: {},
    method: 'get'
  })
}

// 新增/编辑保存接口
export const savRider = params => {
  return axios({
    url: 'userExt/save',
    data: params,
    method: 'POST'
  })
}

// 回收价格列表
export const gePriceList = params => {
  return axios({
    url: 'rubbish/type/queryConvert',
    data: params,
    method: 'POST'
  })
}

// 保存价格
export const savPrice = params => {
  return axios({
    url: 'rubbish/type/update',
    data: params,
    method: 'POST'
  })
}

// 获取订单详情列表
export const getOrderList = params => {
  const url = `/reserve/queryOrderReservePage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}
// 订单总计
export const getOrderTotal = (params) => {
  const url = `/reserve/groupOrderReserve`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 获取订单统计列表
export const getOrderTotalList = params => {
  const url = `/reserve/orderReserveGroupByUserExtPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}
// 订单总计
export const getOrderTotalNum = (params) => {
  const url = `/reserve/groupExtPage`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 订单详情
export const orderDetails = (params) => {
  const url = `/reserve/orderReserveInfo`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// banner图列表
export const getbanerList = params => {
  const url = `/banner/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}

// 改变权限状态接口
export const updateBannerStatus = params => {
  return axios({
    url: `/banner/enable/${params.id}/${params.flag}`,
    data: {},
    method: 'get'
  })
}

// 删除用户接口
export const delecBanner = params => {
  return axios({
    url: `/banner/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}

// 新增/编辑保存接口
export const savBanner = params => {
  return axios({
    url: '/banner/save',
    data: params,
    method: 'POST'
  })
}

// banner详情
export const bannerDetails = (params) => {
  const url = `/banner/getById/${params.id}`
  return axios({
    url: url,
    data: params,
    method: 'get'
  })
}

// 上移下移
export const changeSort = (params) => {
  const url = `/banner/swapBannerSort/${params.id}/${params.sortId}`
  return axios({
    url: url,
    data: {},
    method: 'post'
  })
}
