index.ts 1.59 KB
import request from '../request'
import { deleteEmptyParam } from '@/utils/tool'

/**
 * @description 公益分类
 * @function eventCategory
 */
export const eventCategory = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/craft/craftList',
    params: deleteEmptyParam(params)
  })
  return res
}

/**
 * @description 公益编辑
 * @function eventCategoryEdit
 */
 export const eventCategoryEdit = async ( data: any ) => {
  let res: any = await request({
    method: 'post',
    url: '/craft/insertOrUpdate',
    data: data
  })
  return res
}

/**
 * @description 公益删除
 * @function eventCategoryOmit
 */
 export const eventCategoryOmit = async ( params: any ) => {
  let res: any = await request({
    method: 'delete',
    url: '/craft/deleteCraftById',
    params: params
  })
  return res
}

/**
 * @description 公益详情
 * @function eventCategoryDetail
 */
 export const eventCategoryDetail = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/craft/getCraftById',
    params: params
  })
  return res
}


/**
 * @description 手工活动列表
 * @function handworkList
 */
 export const handworkList = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/handwork/listHandwork',
    params: deleteEmptyParam(params)
  })
  return res
}

/**
 * @description 手工活动编辑
 * @function handworkEdit
 */
 export const handworkEdit = async ( data: any ) => {
  let res: any = await request({
    method: 'post',
    url: '/handwork/insertOrUpdate',
    data: data
  })
  return res
}