import request from '@/utils/request'

// 分销中心
export function getDistributionIndex(data?: any) {
    return request.get({ url: '/distribution/center', data }, { isAuth: true })
}

// 分销申请
export function distributionApply(data: any) {
    return request.post(
        { url: '/distribution/apply', data },
        { isAuth: true }
    )
}

// 分销订单
export function distributionOrder(data?: any) {
    return request.get(
        { url: '/distribution/order/list', data },
        { isAuth: true }
    )
}

// 粉丝列表
export function distributionFans(data?: any) {
    return request.get(
        { url: '/distribution/user/invite/list', data },
        { isAuth: true }
    )
}

// 提现 ---------------------------------------------------------------------------------
export type WithdrawApplyType = {
    money: string | number // 提现金额
    account: string | number // 支付宝账号
    realName: string | number // 支付宝姓名
    type: string | number
    moneyQrcode: string[] | string
}
// 提现申请
export function withdrawApply(data: WithdrawApplyType) {
    return request.post({ url: '/distribution/withdrawal/apply', data }, { isAuth: true })
}

// 提现记录
export function withdrawList(data?: { pageNo: number; pageSize: number }) {
    return request.get({ url: '/distribution/pc/withdrawal/list', data }, { isAuth: true })
}

export function accountLog(data?: any) {
    return request.get(
      { url: '/distribution/getRevenueDetails', data },
      { isAuth: true }
    )
}