import request from "@/utils/request";
// 退出登录
export const logout = (data) => request({ url: "user/logout", method: "post", data,loading:true });
// 获取通知
export const getNotification = () => request({ url: "index/gettong", method: "post", loading: true });
// 套现
export const cashOut = () => request({ url: "user/get_userinfo", method: "post", loading: true });
// 养老金提现
export const withdrawPension = () => request({ url: "index/tiyang", method: "post", loading: true });
// 签到
export const signIn = () => request({ url: "user/sign_in", method: "post", loading: true });
// 提现
export const withdrawCoin = (params) => request({ url: "index/withdrawCoinApp", method: "get", params, loading: true });
// 获取银行卡信息
export const getBankInfo = () => request({ 
  url: "index/get_bank", 
  method: "post", 
  loading: true 
});
// 获取ETH信息
export const getEthInfo = () => request({ url: "index/get_eth_info", method: "get", loading: true });
// 获取提现记录
export const getWithdrawRecords = () => request({ url: "index/get_withrecods", method: "get", loading: true });
// 获取礼品记录
export const getPrizeRecords = () => request({ url: "index/get_jpjl", method: "get", loading: true });
// 获取团队信息
export const getMyTeam = (type) => {
  const formData = new FormData();
  formData.append('type', type);
  return request({
    url: 'index/get_myteam',
    method: 'post',
    data: formData,
    loading: true
  });
};
// 领取红旗资产奖励
export function getShareccb(renshu) {
  return request({
    url: 'index/get_shareccb',
    method: 'post',
    data: new URLSearchParams({ renshu }),
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    loading: true
  });
}
// 获取矿机信息
export const getMinerInfo = (data) => request({
  url: 'index/get_miner_info',
  method: 'post',
  data,
  loading: true
});
// 获取红旗资产奖励领取状态列表
export const getShareccbList = () => request({
  url: 'index/get_shareccb_list',
  method: 'get',
  loading: true
});
// 绑定银行卡
export const setBankInfo = (data) => {
  const formData = new FormData();
  Object.keys(data).forEach(key => {
    formData.append(key, data[key]);
  });
  return request({
    url: 'index/set_bank',
    method: 'post',
    data: formData,
    loading: true
  });
};