import request from "../utils/request.js";
import Method from "./Method.js";

const merchant = {
    sendSms: async (mobile, type) => {
        return request({
            url: '/index/login/sendSms',
            method: Method.POST,
            data: {
                mobile,
                type
            },
        });
    },
    register: async (data) => {
        return request({
            url: '/index/login/register',
            method: Method.POST,
            data: data,
        });
    },
    login: async (data) => {
        return request({
            url: '/index/login/login',
            method: Method.POST,
            data: data,
        });
    },
    phoneLogin: async (data) => {
        return request({
            url: '/index/login/smsLogin',
            method: Method.POST,
            data: data,
        });
    },
    getMenu: async (data) => {
        return request({
            url: '/index/business/getMenu',
            method: Method.POST,
            data: data,
        });
    },
    getPlatformList: async () => {
        return request({
            url: '/index/task/getPlatformList',
            method: Method.POST,
        });
    },
    getMaterialType: async (data) => {
        return request({
            url: '/index/task/getMaterialType',
            method: Method.POST,
            data: data,
        });
    },
    getProvince: async () => {
        return request({
            url: '/index/task/getProvince',
            method: Method.POST,
        });
    },
    getSettlementAfter: async () => {
        return request({
            url: '/index/task/getSettlementAfter',
            method: Method.POST,
        });
    },
    getChooseContent: async (data) => {
        return request({
            url: '/index/task/getChooseContent',
            method: Method.POST,
            data: data
        });
    },
    getNumberOfReleases: async () => {
        return Promise.resolve({
            data: [
                {
                    id: 1,
                    name: '一次'
                },
                {
                    id: 2,
                    name: '两次'
                },
                {
                    id: 3,
                    name: '三次'
                },
                {
                    id: 4,
                    name: '四次'
                },
                {
                    id: 5,
                    name: '五次'
                },
            ]
        })
    },
    getPublicationDuration: async () => {
        return Promise.resolve({
            data: [
                {
                    id: 0,
                    name: '不选择'
                },
                {
                    id: 5,
                    name: '5分钟'
                },
                {
                    id: 10,
                    name: '10分钟'
                },
                {
                    id: 20,
                    name: '20分钟'
                },
                {
                    id: 30,
                    name: '30分钟'
                },
            ]
        })
    },
    createTask: async (data) => {
        return request({
            url: '/index/task/createTask',
            method: Method.POST,
            data: data,
        });
    },
    getTaskPlatformList: async (data) => {
        return request({
            url: '/index/task/getPlatformList',
            method: Method.POST,
            data: data
        });
    },
    getTaskStatusList: async (data) => {
        return request({
            url: '/index/task/getStatusList',
            method: Method.POST,
            data: data
        });
    },
    getTaskList: async (data) => {
        return request({
            url: '/index/task/getTaskList',
            method: Method.POST,
            data: data
        });
    },
    addWithdrawal: async (data) => {
        return request({
            url: '/index/business/addWithdrawal',
            method: Method.POST,
            data: data
        });
    },
    getWithdrawalList: async (data) => {
        return request({
            url: '/index/business/getWithdrawalList',
            method: Method.POST,
            data: data
        });
    },
    getBusinessInfo: async (data) => {
        return request({
            url: '/index/business/getInfo',
            method: Method.POST,
            data: data
        });
    },
    rechargeOrderQR: async (data) => {
        return request({
            url: '/index/business/rechargeOrder',
            method: Method.POST,
            data: data
        });
    },
    saveNickname: async (data) => {
        return request({
            url: '/index/business/saveNickname',
            method: Method.POST,
            data: data
        });
    },
    saveMobile: async (data) => {
        return request({
            url: '/index/business/saveMobile',
            method: Method.POST,
            data: data
        });
    },
    saveWechat: async (data) => {
        return request({
            url: '/index/business/saveWechat',
            method: Method.POST,
            data: data
        });
    },
    savePassword: async (data) => {
        return request({
            url: '/index/business/savePassword',
            method: Method.POST,
            data: data
        });
    },
    saveAvatar: async (data) => {
        return request({
            url: '/index/business/saveAvatar',
            method: Method.POST,
            data: data
        });
    },
    getTaskChildrenList: async (data) => {
        return request({
            url: '/index/task/getTaskChildrenList',
            method: Method.POST,
            data: data
        });
    },
    getMaterialList: async (id) => {
        return request({
            url: '/index/task/getMaterialList',
            method: Method.POST,
            data: {id}
        });
    },
    addMaterial: async (data) => {
        return request({
            url: '/index/task/addMaterial',
            method: Method.POST,
            data: data
        });
    },
    delMaterial: async (id) => {
        return request({
            url: '/index/task/delMaterial',
            method: Method.POST,
            data: {id}
        });
    },
    addChildrenComment: async (data) => {
        return request({
            url: '/index/task/addChildrenComment',
            method: Method.POST,
            data: data
        });
    },
    getChildrenComment: async (id) => {
        return request({
            url: '/index/task/getChildrenComment',
            method: Method.POST,
            data: {id}
        });
    },
    delChildrenComment: async (id) => {
        return request({
            url: '/index/task/delChildrenComment',
            method: Method.POST,
            data: {id}
        });
    },
    editChildrenMaterial: async (data) => {
        return request({
            url: '/index/task/editChildrenMaterial',
            method: Method.POST,
            data: data
        });
    },
    editChildrenMaterimal: async (data) => {
        return request({
            url: '/index/task/editChildrenMaterimal',
            method: Method.POST,
            data: data
        });
    },
    startTask: async (data) => {
        return request({
            url: '/index/task/startTask',
            method: Method.POST,
            data: data
        });
    },
    moneyToTask: async (id) => {
        return request({
            url: '/index/task/moneyToTask',
            method: Method.POST,
            data: {id}
        });
    },
    stopTask: async (id) => {
        return request({
            url: '/index/task/stopTask',
            method: Method.POST,
            data: {id}
        });
    },
    endTask: async (id) => {
        return request({
            url: '/index/task/endTask',
            method: Method.POST,
            data: {id}
        });
    },
    getSettlementBefore: async (data) => {
        return request({
            url: '/index/task/getSettlementBefore',
            method: Method.POST,
            data: data
        });
    },
    getTaskInfo: async (id) => {
        return request({
            url: '/index/task/getTaskInfo',
            method: Method.POST,
            data: {id}
        });
    },
    editTask: async (data) => {
        return request({
            url: '/index/task/editTask',
            method: Method.POST,
            data: data
        });
    },
    getTaskChildrenInfo: async (id) => {
        return request({
            url: '/index/task/getTaskChildrenInfo',
            method: Method.POST,
            data: {id}
        });
    },
    passTask: async (data) => {
        return request({
            url: '/index/task/passTask',
            method: Method.POST,
            data: data
        });
    },
    getCommonRefund: async (data) => {
        return request({
            url: '/index/task/getCommonRefund',
            method: Method.POST,
            data: data
        });
    },
    getDiyRefund: async (data) => {
        return request({
            url: '/index/task/getDiyRefund',
            method: Method.POST,
            data: data
        });
    },
    getSuggestion: async (data) => {
        return request({
            url: '/index/task/getSuggestion',
            method: Method.POST,
            data: data
        });
    },
    refundChildrenTask: async (data) => {
        return request({
            url: '/index/task/refundChildrenTask',
            method: Method.POST,
            data: data
        });
    },
    stopTaskChildren: async (id) => {
        return request({
            url: '/index/task/stopTaskChildren',
            method: Method.POST,
            data: {id}
        });
    },
    addTaskBlock: async (data) => {
        return request({
            url: '/index/task/addTaskBlock',
            method: Method.POST,
            data: data
        });
    },
    addEffect: async (data) => {
        return request({
            url: '/index/task/addEffect',
            method: Method.POST,
            data: data
        });
    },
    confirmTask: async (data) => {
        return request({
            url: '/index/task/confirmTask',
            method: Method.POST,
            data: data
        });
    },
    getTaskSettltment: async (data) => {
        return request({
            url: '/index/task/getTaskSettltment',
            method: Method.POST,
            data: data
        });
    },
    jsTask: async (data) => {
        return request({
            url: '/index/task/jsTask',
            method: Method.POST,
            data: data
        });
    },
    addExchangeLog: async (data) => {
        return request({
            url: '/index/task/addExchangeLog',
            method: Method.POST,
            data: data
        });
    },
    getExchangeLog: async (data) => {
        return request({
            url: '/index/task/getExchangeLog',
            method: Method.POST,
            data: data
        });
    },
    editPassword: async (data) => {
        return request({
            url: '/index/index/editPassword',
            method: Method.POST,
            data: data
        });
    },
    postWithdrawal: async (data) => {
        return request({
            url: '/index/business/postWithdrawal',
            method: Method.POST,
            data: data
        });
    },
    getWithdrawalInfo: async (id) => {
        return request({
            url: '/index/business/getWithdrawalInfo',
            method: Method.POST,
            data: {id}
        });
    },
    editWithdrawal: async (data) => {
        return request({
            url: '/index/business/editWithdrawal',
            method: Method.POST,
            data: data
        });
    },
    delWithdrawal: async (id) => {
        return request({
            url: '/index/business/delWithdrawal',
            method: Method.POST,
            data: {id}
        });
    },
    getBusinessMoneyLog: async (data) => {
        return request({
            url: '/index/business/getBusinessMoneyLog',
            method: Method.POST,
            data: data
        });
    },
    getPurpose: async (data) => {
        return request({
            url: '/index/business/getPurpose',
            method: Method.POST,
            data: data
        });
    },
    getTaskBlock: async (data) => {
        return request({
            url: '/index/task/getTaskBlock',
            method: Method.POST,
            data: data
        });
    },
    cancelTaskBlock: async (data) => {
        return request({
            url: '/index/task/cancelTaskBlock',
            method: Method.POST,
            data: data
        });
    },
    getTaskEffect: async (data) => {
        return request({
            url: '/index/task/getTaskEffect',
            method: Method.POST,
            data: data
        });
    },
    cancelTaskEffect: async (data) => {
        return request({
            url: '/index/task/cancelTaskEffect',
            method: Method.POST,
            data: data
        });
    },
    saveMode: async (data) => {
        return request({
            url: '/index/task/saveMode',
            method: Method.POST,
            data: data
        });
    },
    getModeList: async (data) => {
        return request({
            url: '/index/task/getModeList',
            method: Method.POST,
            data: data
        });
    },
    TemplateToTask: async (data) => {
        return request({
            url: '/index/task/TemplateToTask',
            method: Method.POST,
            data: data
        });
    },
    delTemplate: async (data) => {
        return request({
            url: '/index/task/delTemplate',
            method: Method.POST,
            data: data
        });
    },
    weighTemplate: async (data) => {
        return request({
            url: '/index/task/weighTemplate',
            method: Method.POST,
            data: data
        });
    },
    saveNewTask: async (data) => {
        return request({
            url: '/index/task/saveNewTask',
            method: Method.POST,
            data: data
        });
    },
    getRechargeLog: async (data) => {
        return request({
            url: '/index/business/getRechargeLog',
            method: Method.POST,
            data: data
        });
    },
    getWithdrawalLog: async (data) => {
        return request({
            url: '/index/business/getWithdrawalLog',
            method: Method.POST,
            data: data
        });
    },
    findTask: async (data) => {
        return request({
            url: '/index/task/findTask',
            method: Method.POST,
            data: data
        });
    },
    getChildrenInfo: async (id) => {
        return request({
            url: '/index/task/getChildrenInfo',
            method: Method.POST,
            data: {id}
        });
    },
    getEffectLog: async (data) => {
        return request({
            url: '/index/business/getEffectLog',
            method: Method.POST,
            data: data
        });
    },
    finshReply: async (data) => {
        return request({
            url: '/index/task/finshReply',
            method: Method.POST,
            data: data
        });
    },
    getBackinfo: async (data) => {
        return request({
            url: '/index/task/getBackinfo',
            method: Method.POST,
            data: data
        });
    },
    intervention: async (data) => {
        return request({
            url: '/index/task/intervention',
            method: Method.POST,
            data: data
        });
    },
    interventionV2: async (data) => {
        return request({
            url: '/index/Task/addIntervention',
            method: Method.POST,
            data: data
        });
    },
    againWithdrawal: async (data) => {
        return request({
            url: '/index/business/againWithdrawal',
            method: Method.POST,
            data: data
        });
    },
    checkOrder: async (data) => {
        return request({
            url: '/index/business/checkOrder',
            method: Method.POST,
            data: data,
            headers: {
                message: true,
            }
        });
    },
}

export default merchant;
