/*
 * @Author: micky 1254597151@qq.com
 * @Date: 2023-09-04 09:43:15
 * @LastEditors: micky 1254597151@qq.com
 * @LastEditTime: 2023-10-05 09:34:05
 * @FilePath: \housekeeping-admin\src\api\distributor\lists.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
import axios from 'axios'

// 分销列表
export function apiDistributorLists(params: any) {
    return request.get({ url: '/distributor/list', params })
}
// 添加分销
export function apiDistributorAdd(params: any) {
    return request.post({ url: '/distributor/add', params })
}
// 编辑分销
export function apiDistributorEdit(params: any) {
    return request.post({ url: '/distributor/edit', params })
}

// 删除分销
export function apiDistributorDel(params: any) {
    return request.post({ url: '/distributor/del', params })
}

// 分销详情
export function apiDistributorDetail(params: any) {
    return request.get({ url: '/distributor/detail', params })
}

// 二维码
export function apiDistributorQrcode(params: any) {
    return request.post({ url: '/distributor/genQRCode', params })
}

// 查看订单
export function apiDistributorQrder(params: any) {
    return request.post({ url: '/order/listDistributionOrder', params })
}

// 导出订单
export function apiDistributorExcel(params: any) {
    return request.post(
        { responseType: 'blob', url: '/order/exportDistOrderExcel', params },
        {
            isTransformResponse: false
        }
    )
}
// 获取未绑定分销商用户
export function apiUnBindingDistributor(params: any) {
    return request.get({ url: '/user/getNotBindingDistributorUser', params })
}
// 查看优惠券
export function apiDistributorCoupon(params: any) {
    return request.get({ url: '/channelCoupon/getDistributorCoupon', params })
}
