import request from '@/utils/request'
import {BASE, AUTH} from "@/api/apiGateway"
import { ContactEdit } from 'vant'

export function getAuthorizeMembers(){
    return request({
        url: `${BASE}/family/authorize_members`,
        method: 'get'
    })
}

export function checkMember(){
    return request({
        url: `${BASE}/family/check_member`,
        method: 'get'
    })
}

export function isAuthorize(){
    return request({
        url: `${BASE}/family/is_authorize`,
        method: 'get'
    })
}

export function isRegister(params){
    return request({
        url: `${BASE}/family/is_register`,
        method: 'get',
        params
    })
}

export function addMember(data){
    return request({
        url: `${BASE}/family/member_add`,
        method: 'post',
        data
    })
}

export function memberAuthorize(data){
    return request({
        url: `${BASE}/family/member_authorize`,
        method: 'post',
        data
    })
}

export function deleteMember(data){
    return request({
        url: `${BASE}/family/member_delete`,
        method: 'post',
        data
    })
}

export function getMembers(params){
    return request({
        url: `${BASE}/family/members`,
        method: 'get',
        params
    })
}

export function updateRelation(data){
    return request({
        url: `${BASE}/family/relation_update`,
        method: 'post',
        data
    })
}

export function addMemberByCaptcha(data){
    return request({
        url: `${BASE}/family/addMemberByCaptcha`,
        method: 'post',
        data
    })
} 

export function addMemberByPw(data){
    return request({
        url: `${BASE}/family/addMemberByPw`,
        method: 'post',
        data
    })
}
//  绑定家人不存在时为家人注册
export function registerForFamily(data){
    return request({
        url: `${BASE}/patient/registerForFamily`,
        method: 'post',
        data
    })
}