import upload from '@/utils/upload'
import request from '@/utils/request'

//------------------博主、通告主-----------------------
//查询博主详情
export function bloggerDetail(userId) {
    return request({
        url: '/member/member/bloggerDetail/' + userId,
        method: 'get'
    })
}


//------------------开通会员-----------------------
export function saveOrder(data) {
    return request({
        url: '/member/order/uniSaveOrder',
        method: 'post',
        data: data
    })
}
//------------------名片-----------------------
// 查询当前登录用户的名片
export function getUserBusiCard() {
    return request({
        url: '/member/busiCard/listByUser',
        method: 'get',
    })
}
// 获取博主名片详情
export function getBusiCardById(params) {
    return request({
        url: '/member/busiCard/getBusiCardById',
        method: 'get',
        params:params
    })
}
//提交博主名片审核申请
export function applyBusiCard(data) {
    return request({
        url: '/member/busiCard/toApply',
        method: 'post',
        data: data
    })
}
//删除名片信息
export function removeBusiCard(params) {
    return request({
        url: '/member/busiCard/remove',
        method: 'delete',
        params:params
    })
}

//------------------地址-----------------------
// 查询当前登录用户的收货地址
export function getUserAddress() {
    return request({
        url: '/member/address/listByUser',
        method: 'get',
    })
}
// 博主地址选择器
export function uniSelectList() {
    return request({
        url: '/member/address/uniSelectList',
        method: 'get',
    })
}
//保存地址信息
export function saveAddress(data) {
    return request({
        url: '/member/address/save',
        method: 'post',
        data: data
    })
}
// 设置默认收货地址
export function setDefault(params) {
    return request({
        url: '/member/address/setDefault',
        method: 'get',
        params: params
    })
}
// 删除地址
export function removeAddress(params) {
    return request({
        url: '/member/address/remove',
        method: 'delete',
        params:params
    })
}
// 获取地址详细信息
export function getById(params) {
    return request({
        url: '/member/address/getById',
        method: 'get',
        params:params
    })
}