import request from '@/utils/request'

// 订单统计信息
export function orderData(data) {
	return request({
		url: '/api/order/data',
		method: 'get',
		data
	});
}

// 获取用户信息
export function userinfo(data) {
	return request({
		url: '/api/userinfo',
		method: 'get',
		data
	});
}
// getLevel 获取等级数据
export function getLevel(data) {
	return request({
		url: '/api/user/level/grade',
		method: 'get',
		data
	});
}

//
export function commission(data) {
	return request({
		url: '/api/commission',
		method: 'get',
		data
	});
}
// 获取用户信息
export function getUserInfo(data) {
	return request({
		url: '/api/userinfo',
		method: 'get',
		data
	});
}

//购买会员
export function bvip(data) {
	return request({
		url: '/api/level/recharge',
		method: 'post',
		data
	});
}

/**
 * 客服列表
 */
export function serviceList() {
	return request({
		url: "/api/user/service/list",
		method: 'get',
	});
}

/**
 * 客服详情
 */
export function getChatRecord(to_uid, data) {
	return request({
		url: "/api/user/service/record/" + to_uid,
		method: 'get',
		data
	});
}

/**
 * 获取产品详情
 * @param int id
 * 
 */
export function getProductDetail(id) {
	return request({
		url: '/product/detail/' + id,
		method: 'get',
		data: {}
	});
}

// 获取会员信息
export function levelGrade(data) {
	return request({
		url: '/user/level/grade',
		method: 'get',
		data
	});
}

//佣金总和
export function spreadCount(data, type) {
	return request({
		url: '/api/spread/count/' + type,
		method: 'GET',
		data
	});
}

// 获取用户信息
export function userinfos(data) {
	return request({
		url: '/api/user',
		method: 'get',
		data
	});
}

// 获取佣金明细
export function getCommissionInfo(data, type) {
	return request({
		url: '/api/spread/commission/' + type,
		method: 'get',
		data
	});
}

//我的券码
export function getMyYhq(data) {
	return request({
		url: '/api/produce',
		method: 'get',
		data
	})
}

//券码详情
export function getYhqDetail(data, id) {
	return request({
		url: '/api/produce/' + id,
		method: 'get',
		data
	})
}

// 核销项目码
export function check(data) {
	return request({
		url: '/api/produce/check',
		method: 'post',
		data
	})
}

// 转赠项目码
export function transfer(data, id) {
	return request({
		url: '/api/produce/trade/' + id,
		method: 'post',
		data
	})
}

// H5授权
export function h5Auth(data, id) {
	return request({
		url: '/api/h5Auth/' + id,
		method: 'post',
		data
	})
}
