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 announcerDetail(userId) {
	return request({
		url: '/member/member/announcerDetail/' + userId,
		method: 'get'
	})
}
//查询通告主详情
export function getMemberDetail() {
	return request({
		url: '/member/member/getMemberDetail',
		method: 'get'
	})
}
export function queryDetail(params) {
	return request({
		url: '/member/member/queryDetail',
		method: 'get',
		params: params
	})
}
//查询黑名单
export function blackList(params) {
	return request({
		url: '/member/blacklist/list',
		method: 'get',
		params: params
	})
}
//删除黑名单
export function removeBlackList(params) {
	return request({
		url: '/member/blacklist/removeById',
		method: 'delete',
		params: params
	})
}
//保存博主
export function uniSaveMember(data) {
	return request({
		url: '/member/member/uniSaveMember',
		method: 'post',
		data: data
	})
}
//通告主认证申请
export function toApply(data) {
	return request({
		url: '/member/apply/toApply',
		method: 'post',
		data: data
	})
}
//消耗权益值
export function dealMemberRights(params) {
	return request({
		url: '/member/card/dealMemberRights',
		method: 'get',
		params: params
	})
}


//------------------名片-----------------------
// 查询当前登录用户的名片
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
	})
}

//获取会员权益
export function selectMemberRights() {
	return request({
		url: '/member/card/selectMemberRights',
		method: 'get'
	})
}
//------------------订单相关-----------------------
export function getOrderList(params) {
	return request({
		url: '/member/order/list',
		method: 'get',
		params: params
	})
}

export function prepayment(data) {
	return request({
		url: '/payApi/prepayment',
		method: 'get',
		params: data
	})
}

export function saveOrder(data) {
	return request({
		url: '/member/order/uniSaveOrder',
		method: 'post',
		data: data
	})
}
//积分列表
export function pointList(params) {
	return request({
		url: '/member/points/list',
		method: 'get',
		params: params
	})
}
//新增黑名单
export function saveBlack(data) {
	return request({
		url: '/member/blacklist/saveBlack',
		method: 'post',
		data: data
	})
}

//查询急招券
export function getMemberCoupon() {
	return request({
		url: '/member/coupon/getMemberCoupon',
		method: 'get',
	})
}

//查询在途提现订单
export function getOnWayOrder() {
	return request({
		url: '/member/points/getOnWayOrder',
		method: 'get',
	})
}

//积分提现
export function payout(data) {
	return request({
		url: '/member/points/payout',
		method: 'post',
		data: data
	})
}

//判断是否领取过新人好礼 0否 1是
export function isGetGift() {
	return request({
		url: '/member/member/isGetGift',
		method: 'post'
	})
}

//判断是否领取过新人好礼 0否 1是
export function sendNewGift() {
	return request({
		url: '/member/member/sendNewGift',
		method: 'post'
	})
}