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 getAddress(data,id) {
	return request({
		url: '/api/address/detail/'+id,
		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 getAddressDefault(data) {
	return request({
		url: '/api/address/default',
		method: 'get',
		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 getSpreadPeople(data){
	return request({
		url:'/api/spread/people',
		method:'post',
		data
	})
}

//推广佣金/提现总和 
//3=佣金,4=提现
export function getSpreadCount(data,type) {
	return request({
		url:'/api/spread/count/'+type,
		method:'get',
		data
	})
}

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

 // 订单核销
export function orderVerific(data) {
  return request({
  	url:'/api/order/order_verific',
  	method:'post',
  	data
  })
}

//核销列表
export function getOrderList(data) {
  return request({
  	url:'/api/order/order_verific',
  	method:'post',
  	data
  })
}

//获取管理商品列表
export function getAllList(data) {
	return request({
		url:'/api/admin/order/list',
		method:'get',
		data
	})
}
//admin/point自提点列表
export function getPoint(data) {
	return request({
		url:'/api/admin/point',
		method:'get',
		data
	})
}
//admin/point/5删除自提点
export function delPoint(data,id) {
	return request({
		url:'/api/admin/point/' + id,
		method:'delete',
		data
	})
}
//admin/point/1
export function editPoint(data,id) {
	return request({
		url:'/api/admin/point/'+ id,
		method:'post',
		data
	})
}

// 核销兑换券
export function exchangeOrderVerific(data) {
	return request({
		url:'/api/order/exchange_order_verific',
		method:'post',
		data
	})
}

//获取送货员列表
export function getSHY(data) {
	return request({
		url:'/api/admin/sender',
		method:'get',
		data
	})
}

//佣金明细
export function getStoreCms(data) {
	return request({
		url:'/api/order/bill',
		method:'get',
		data
	})
}
// 佣金提现
export function cash(data) {
	return request({
		url:'/api/order/cash',
		method:'post',
		data
	})
}

// 发放实体卡
export function sendStk(data) {
	return request({
		url:'/api/admin/card/send',
		method:'post',
		data
	})
}

// 核销实体卡
export function checkStk(data) {
	return request({
		url:'/api/admin/card/check',
		method:'post',
		data
	})
}

// 实体卡列表
export function getStk(data) {
	return request({
		url:'/api/admin/card/send',
		method:'get',
		data
	})
}