import Controller from "./Controller";
import Route from "./actions/route";
class Api extends Controller {
  constructor() {
    super();
  }
  /**
   * 支付方式
   * @returns api
   */
  getPayMethodList = () => {
    return this.request(Route.getPayMethodList);
  };
  /**
  * 支付方式2
  * @returns api
  */
  getPayClass = () => {
    return this.request(Route.getPayClass);
  };
  /**
   * 充值商品列表
   * @returns api
   */
  depositList = () => {
    return this.request(Route.depositList);
  };
  /**
   * 用户充值动作
   * @param {String} _id 商品_id字符串
   * @param {Number} method 支付方式
   * @returns api
   */
  userDeposit = (data) => {
    return this.request(Route.userDeposit, data);
  };
  /**
   * 充值记录
   * @param {Number} pageIndex 页码
   * @param {Number} pageSize 每页记录数
   * @returns api
   */
  getPayRecords = (data) => {
    return this.request(Route.getPayRecords, data);
  };
  /**
   * 钻石兑换金币
   * @returns api
   */
  convert = () => {
    return this.request(Route.convert);
  };
  /**
   * 金币流水
   * @param {Number} pageIndex 页码
   * @param {Number} pageSize 每页记录数
   * @returns api
   */
  getFlowRecord = (data) => {
    return this.request(Route.getFlowRecord, data);
  };
  /**
   * 超值礼包三选一
   * @returns api
   */
  getOneOfThree = () => {
    return this.request(Route.getOneOfThree);
  };
  /**
   * 购买礼包三选一
   * @param {String} _id 商品_id
   * @param {Number} method 支付方式
   * @param {*} data
   * @returns api
   */
  oneOfThreeBuy = (data) => {
    return this.request(Route.oneOfThreeBuy, data);
  };
  /**礼包领取 */
  oneOfThreeReceive = () => {
    return this.request(Route.oneOfThreeReceive);
  };
  /**
   * 获取提现渠道
   * @returns api
   */
  getTransMethodList = () => {
    return this.request(Route.getTransMethodList);
  };
  /**
   * 用户提现
   * @param {Number} amount 提现金额
   * @param {String} method 提现方式
   * @param {String} account 提现账户
   * @param {String} holder 持有者
   * @returns api
   */
  userWithdraw = (data) => {
    return this.request(Route.userWithdraw, data);
  };
  /**
   * 提现日志
   * @param {Number} pageIndex 页码
   * @param {Number} pageSize 每页记录数
   * @returns
   */
  getWithDrawRecord = (data) => {
    return this.request(Route.getWithDrawRecord, data);
  };
  /**
   * 个人下注返利
   * @returns
   */
  getTotalRebate = () => {
    return this.request(Route.getTotalRebate);
  };
  /**
   * 领取个人下注返利
   * @returns
   */
  receiveTotalRebate = () => {
    return this.request(Route.receiveTotalRebate);
  };
  /**
   * 校准金币
   */
  getCoinsNum = () => {
    return this.request(Route.getCoinsNum);
  };
  /**
   * vip 日周月领奖
   * @param {number} awardType 领奖类型 0每日奖励 1每周奖励 2每月奖励
   * @returns
   */
  getVipAwardCycle = (awardType) => {
    return this.request(Route.getVipAwardCycle, { awardType });
  };
  /**
   * 获取vip配置详情
   * @returns
   */
  getVipLvInfo = () => {
    return this.request(Route.getVipLvInfo);
  };
  /**
   * vip等级领取
   * @param {String} _id vi配置_id字段
   * @returns
   */
  getVipLvAward = (_id) => {
    return this.request(Route.getVipLvAward, { _id });
  };
  /**
   * 无限代理
   * @returns
   */
  getChildRebate = () => {
    return this.request(Route.getChildRebate);
  };
  /**
   * 无限代理 领取奖金
   * @returns
   */
  receiveChildRebate = (data) => {
    return this.request(Route.receiveChildRebate, data);
  };
  getChildRebateInfo = (data) => {
    return this.request(Route.getChildRebateInfo, data);
  }
  getChildRebateRecordsDetail = (data) => {
    return this.request(Route.getChildRebateRecordsDetail, data);
  }
  getChildRebateRecords = (data) => {
    return this.request(Route.getChildRebateRecords, data);
  }
  /**
   * 无限代理 返利列表
   * @returns
   */
  getChildRebateDetail = (data) => {
    return this.request(Route.getChildRebateDetail, data);
  };
  /**
   * 活动任务
   * @returns
   */
  getCustomClassList = () => {
    return this.request(Route.getCustomClassList);
  };
  /**
   * 活动任务 列表查询
   * @returns
   */
  getTaskList = (data) => {
    return this.request(Route.getTaskList, data);
  };
  /**
   * 获取 道具
   * @returns
   * @param {String} propId vi配置_id字段
   */
  updatePropsCache = (data) => {
    return this.request(Route.updatePropsCache, data);
  };
  /**
   * 获取转盘数据
   * @param {Number} recordSize 
   * @returns 
   */
  getHelpTurntable = (data) => {
    return this.request(Route.getHelpTurntable, data)
  }
  /**
   *获取转盘结果 
   * @returns 
   */
  getHelpTurntableResult = () => {
    return this.request(Route.getHelpTurntableResult)
  }
  /**
 *获取转盘结果 
 * @returns 
 */
  getTaskAward = (data) => {
    return this.request(Route.getTaskAward, data)
  }
  /**
   * 转盘领奖
   * @returns 
   */
  helpTurntableTaskAward = (_id) => {
    return this.request(Route.helpTurntableTaskAward, { _id })
  }
  /**
   * 邮件
   * @returns 
   */
  getMail = (data) => {
    return this.request(Route.getMail, data)
  }
  setMailRead = (_id) => {
    return this.request(Route.setMailRead, { _id })
  }
  getMailAttachments = (_id) => {
    return this.request(Route.getMailAttachments, { _id })
  }
  checkNewMail = () => {
    return this.request(Route.checkNewMail)
  }
  /**
   * 银行账户管理
   * @returns 
   */
  getWithDrawAccount = () => {
    return this.request(Route.getWithDrawAccount)
  }
  /**
   * 推广电话
   * @returns 
   */
  getPopularizePhones = () => {
    return this.request(Route.getPopularizePhones)
  }
  /**
   * 
   * @param {*} data 
   * @returns 
   */
  getHelpTurntable2Log = (data) => {
    return this.request(Route.getHelpTurntable2Log, data)
  }
  /**
  * 获取游戏跳转路径
  * @returns 
  */
  getGameUrl = (data) => {
    let isMobile
    if (/(Mobile|iPhone|iPod|iOS|Android)/i.test(navigator.userAgent)) {
      isMobile = true
    } else {
      isMobile = false
    }
    const p = { ...data, isMobile, }
    return this.request(Route.getGameUrl, p)
  }

  /**
   * 通知绑定上级id
   * @param {Number} inviteUid 
   * @returns 
   */
  acceptInvite = (inviteUid) => {
    return this.notify(Route.acceptInvite, { inviteUid })
  }

  /**
   * 兑换码  兑换
   * @param {code} code 
   * @returns 
   */
  giftCode = (code) => {
    return this.request(Route.giftCode, { code })
  }
  /**
   * 周返现 获取
   */
  getCycleRebate = () => {
    return this.request(Route.getCycleRebate)
  }
  receiveCycleRebateLoss = () => {
    return this.request(Route.receiveCycleRebateLoss)
  }
  /**
 * 游戏金额流水
 * @param {Number} pageIndex 页码
 * @param {Number} pageSize 每页记录数
 * @returns api
 */
  getCoinsDetailLog = (data) => {
    return this.request(Route.getCoinsDetailLog, data);
  };
  /**
* 游戏金额流水
* @param {id} id 道具ID
* @returns api
*/
  getPropsCache = (data) => {
    return this.request(Route.getPropsCache, data);
  };
  /**
* 拼单单获取活动数据
* @returns api
*/
  getPddTask = () => {
    return this.request(Route.getPddTask);
  };

  pddAddProbability = (data) => {
    return this.request(Route.pddAddProbability, data);
  };

  pddAwardRecords = (data) => {
    return this.request(Route.pddAwardRecords,data);
  };
  pddPointsBuy = (data) => {
    return this.request(Route.pddPointsBuy,data);
  };
  getCheckin = (data) => {
    return this.request(Route.getCheckin,data);
  };
  checkinDay = (data) => {
    return this.request(Route.checkinDay,data);
  };
  getNotice = (data) => {
    return this.request(Route.getNotice,data);
  };
  setNoticeRead = (data) => {
    return this.request(Route.setNoticeRead,data);
  };
  checkNewNotice = (data) => {
    return this.request(Route.checkNewNotice,data);
  };
}
export default new Api();
