import request from '../utils/request'

//志愿者注册
export function add(data) {
    return request({
        url: `/core/volunteer/info/newVolunteerInfo/${data.serviceCategory}`,
        method: 'post',
        data: data
    })
}

//志愿者信息回显
export function getVolunteerInfo(data) {
    return request({
        url: `/core/volunteer/info/volunteerInfo`,
        method: 'get',
        params: data
    })
}


//修改志愿者排班日期
export function workDate(data) {
    return request({
        url: `/core/volunteer/work-date`,
        method: 'put',
        data: data
    })
}



//获取志愿者排班日期
export function getDataTime() {
    return request({
        url: `/core/volunteer/work-date/getWorkDateAndTime`,
        method: 'get',
    })
}

//志愿者订单列表
export function getVolunteerOrderList(data) {
    return request({
        url: `/core/volunteer/orders/volunteerOrderList`,
        method: 'get',
        params: data
    })
}

//志愿者订单详情,（收货地址和状态）
export function getVolunteerOrderInfo(data) {
    return request({
        url: `/core/volunteer/orders/volunteerOrderInfo`,
        method: 'get',
        params: data
    })
}


//志愿者滑动，开始订单
export function getTimesByDate(data) {
    return request({
      url: `/core/volunteer/orders/volunteerStartSecondOrder?${data}`,
      method: 'post',
    })
}
//志愿者点击结束订单
export function getVolunteerFinishSecondOrder(data) {
    return request({
        url: `/core/volunteer/orders/volunteerFinishSecondOrder?${data}`,
        method: 'post'
    })
}


//获取志愿者账户详细信息
export function getVolunteerAccount(volunteerAccountId) {
    return request({
        url: `/core/volunteer/account/${volunteerAccountId}`,
        method: 'get',
    })
}


//查询所有业务列表(树形结构)
export function getTreeList(query) {
    return request({
      url: '/core/business/management/getTreeList',
      method: 'get',
      params: query
    })
  }