
import {http, Method} from '@/utils/request.js';
// import { http, Method } from "@/utils/request.js";

import api from "@/config/api.js";
/**
 * 签到
 * @param params
 */
export function sign() {
  return http.request({
    url: '/members/sign',
    method: Method.POST,
    needToken: true,
  });
}
/**
 * 获取推荐码
 * @param params
 */
export function mymon() {
  return http.request({
    url: '/share/code/my',
    method: Method.GET,
    needToken: true,
  });
}
/**
 * 达人下的用户
 * @param params
 */
export function bindUsers() {
  return http.request({
    url: '/share/code/expert/bind/users',
    method: Method.GET,
    needToken: true,
  });
}

/**
 * 分销的消费记录
 * @param params
 */
export function getcompleted(data) {
  return http.request({
    url: '/share/code/completed-orders',
    method: Method.GET,
    needToken: true,
    params:data
  });
}
/**
 * 我的核销-收益明细
 * @param params
 */
export function getgetAmount(data) {
  return http.request({
    url:'/income/details',
    method: Method.GET,
    needToken: true,
    params:data
  });
}
/**
 * 我的核销
 * @param params
 */
export function getinvitation(data) {
  return http.request({
    url:'/income/invitation-stats',
    method: Method.GET,
    needToken: true,
    params:data
  });
}
/**
 * 我的核销-分佣
 * @param params
 */
export function gettotal(data) {
  return http.request({
    url:'/income/total',
    method: Method.GET,
    needToken: true,
    params:data
  });
}


/**
 * 绑定推荐码
 * @param params
 */
export function inviteCode(data) {
  return http.request({
    url: '/share/code/bind/'+data,
    method: Method.POST,
    needToken: true,
  });
}

/**
 * 签到时间获取
 * @param params
 */
export function signTime(time) {
  return http.request({
    url: '/members/sign?time='+time,
    method: Method.GET,
    needToken: true,
  });
}
