import request from '@/utils/request'
import {
	upFilse
} from '@/utils/request';
//用户修改信息
export function edit(data) {
	return request({
		url: '/api/user/edit',
		method: 'post',
		data
	});
}
// 订单统计信息
export function orderData(data) {
	return request({
		url: '/api/order/data',
		method: 'get',
		data
	});
}

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

// 用户分享图
export function spreadBanner(data) {
	return request({
		url: '/api/spread/banner',
		method: 'get',
		data
	});
}

// 获取地址列表
export function getAddressList(data) {
	return request({
		url: '/api/address/list',
		method: 'get',
		data
	});
}
// 修改地址
export function addressEdit(data) {
	return request({
		url: '/api/address/edit',
		method: 'post',
		data
	});
}
// 删除地址
export function addressDel(data) {
	return request({
		url: '/api/address/del',
		method: 'post',
		data
	});
}
// 设为默认地址
export function setAddressDefault(data) {
	return request({
		url: '/api/address/default/set',
		method: 'post',
		data
	});
}
// 购物车列表
export function getCartList(data) {
	return request({
		url: '/api/cart/list',
		method: 'get',
		data
	});
}

// 修改购物车数量
export function getCartNum(data) {
	return request({
		url: '/api/cart/num',
		method: 'post',
		data
	});
}
//删除购物车
export function cartDel(data) {
	return request({
		url: '/api/cart/del',
		method: 'post',
		data
	});
}
//获取收藏夹列表
export function getcollectList(data) {
	return request({
		url: '/api/collect/user',
		method: 'get',
		data
	});
}
// 取消收藏
export function delcollect(data) {
	return request({
		url: '/api/collect/del',
		method: 'post',
		data
	});
}


//上传图片
export function upload(data) {
	return upFilse({
		url: '/api/upload/image',
		method: 'post',
		data
	})
}


//上传图片
export function repurchase(data) {
	return request({
		url: '/api/user/repurchase',
		method: 'get',
		data
	})
}

// 推广的人数
export function getSpreadPeople(data) {
	return request({
		url: '/api/spread/people',
		method: 'post',
		data
	})
}

// 获取用户名称
export function nickname(data) {
	return request({
		url: '/api/nickname',
		method: 'get',
		data
	});
}

export function transfer(data) {
	return request({
		url: '/api/transfer',
		method: 'post',
		data
	});
}

//获取会员
export function getVip(data) {
	return request({
		url: '/api/level/lst',
		method: 'get',
		data
	});
}

//开通会员
export function becomeVip(data) {
	return request({
		url: '/api/level/recharge',
		method: 'post',
		data
	});
}

// 店家认证
export function editStore(data) {
	return request({
		url: '/api/user/apply',
		method: 'post',
		data
	});
}

// 用户拥有商品
export function user_product(data) {
	return request({
		url: '/api/user/user_product',
		method: 'get',
		data
	});
}


export function jfzz(data) {
	return request({
		url: '/api/user/accounts',
		method: 'post',
		data
	});
}