import request from '../utils/request.js'

import config from '../utils/config'


// login
// 用户登录
export const userLogin = data => {
	return request.post('/wechat/wxapp/session', data)
}

// 绑定用户昵称和头像
export const userBindNickname = data => {
	return request.post('/wechat/auth.center/bindUser', data)
}

// 用户绑定手机号
export const userBindPhone = data => {
	return request.post('/wechat/auth.center/bindPhone', data)
}

// 获取用户数据
export const getUserInfo = data => {
	return request.get('/wechat/auth.center/get', data)
}
// 获取用户数据
export const getCustomerInfo = data => {
	return request.get('/wechat/auth.center/customer', data)
}
// 更新用户资料
export const updateUserInfo = data => {
	return request.post('/wechat/auth.center/save', data)
}

// 手机号登录
export const memberLogin = data => {
	return request.post('/prod-api/member/login', data)
}

// 获取用户信息
export const getMemberInfo = data => {
	return request.get('/prod-api/member/info', data)
}


// 获取积分记录
export const getIntegralTrade = data => {
	return request.get('/prod-api/integral-trade/list', data)
}
// 用户注册
export const userRegister = data => {
	return request.post('/data/api.auth.center/reg', data)
}


// 获取会员等级
export const getUserUpgrade = data => {
	return request.post('/data/api.data/userUpgrade', data)
}

// 添加订单
export const addOrder = data => {
	return request.post('/data/api.auth.order/add', data)
}


// 支付订单
export const payOrder = data => {
	return request.post('/data/api.auth.order/payment', data)
}


// 获取我邀请的朋友
export const getFrom = data => {
	return request.post('/data/api.auth.center/getFrom', data)
}



// 获取我得推广付费记录
export const getFromVip = data => {
	return request.post('/data/api.auth.center/getFromOrders', data)
}


// 获取我邀请的用户统计
export const getFromCnt = data => {
	return request.post('/data/api.auth.center/getFromCnt', data)
}


// 获取我的认证列表
export const getAuthenticationList = data => {
	return request.post('/data/api.auth.cert/index', data)
}



// 添加或修改用户认证
export const saveAuthentication = data => {
	return request.post('/data/api.auth.cert/save', data)
}
