import request from '@/utils/request'

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

// 获取用户信息
export function getUserInfo(data) {
	return request({
		url: '/api/user/info',
		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
	});
}


//http://hmd.frp.liuniu946.com/api/brokerage/list?page=1&limit=10&pm=1
export function getCommissionInfo(data) {
	return request({
		url: '/api/brokerage/list',
		method: 'get',
		data
	});
}

//我的推广
export function myspread(data) {
	return request({
		url: '/api/spread/people',
		method: 'POST',
		data
	});
}


//
export function sqdl(data) {
	return request({
		url: '/api/user/apply',
		method: 'POST',
		data
	});
}

export function details(data, id) {
	return request({
		url: '/api/article/details/' + id,
		method: 'get',
		data
	});
}

export function yjzye(data) {
	return request({
		url: '/api/user/transformation',
		method: 'post',
		data
	})
}

//转账
export function jfzz(data) {
	return request({
		url: '/api/recharge/trade_money',
		method: 'post',
		data
	})
}

export function getLevelList(data) {
	// api/give_level_list
	return request({
		url: '/api/user/level/grade',
		method: 'get',
		data
	})
}

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

export function bankInfo() {
	return request({
		url: '/api/bank/info',
		method: 'get'
	})
}

export function userPool() {
	return request({
		url: '/api/user/pool',
		method: 'get'
	})
}

//佣金转换
export function rechargeWechat(data) {
	return request({
		url: '/api/recharge/wechat',
		method: 'post',
		data
	})
}

export function goft() {
	// recharge/resumption
	return request({
		url: '/api/recharge/resumption',
		method: 'post',
	})
}

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

//
export function getAli(data) {
	return request({
		url: '/api/ali/info',
		method: 'get',
		data
	})
}


export function getWx(data) {
	return request({
		url: '/api/wx/info',
		method: 'get',
		data
	})
}


export function setAli(data) {
	return request({
		url: '/api/ali/edit',
		method: 'post',
		data
	})
}

export function setWx(data) {
	return request({
		url: '/api/wx/edit',
		method: 'post',
		data
	})
}

export function getUserCard(data) {
	return request({
		url: '/api/card',
		method: 'get',
		data
	})
}

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

export function goHx(data) {
	return request({
		url: '/api/order/order_verific',
		method: 'post',
		data
	})
}

//获取openid
export function getOpenId(data) {
	return request({
		url: '/api/wechat/getopenid',
		method: 'get',
		data
	});
}

export function getFQr(data) {
	return request({
		url: '/api/user/randCode',
		method: 'get',
		data
	});
}

export function latlngToAddress(data) {
	// 
	return request({
		url: '/api/address/point_to_address',
		method: 'post',
		data
	});
}
//getCity
export function getCity(data) {
	return request({
		url: '/api/city',
		method: 'get',
		data
	});
}

export function getLevelLists(data) {
	return request({
		url: '/api/user/level',
		method: 'get',
		data
	});
}

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

export function paylevel(data) {
	return request({
		url: '/api/user/level/pay',
		method: 'post',
		data
	});
}

export function getRechangeList(data) {
	return request({
		url: '/api/user/recharge/sys_level',
		method: 'get',
		data
	});
}

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

// //充值
// Route::post('recharge', 'user.UserRecharge/recharge') - > name('recharge') - > middleware(BlockerMiddleware::class) - >
// 	middleware(TradeMiddleware::class);
// Route::get('recharge/sys_level', 'user.UserRecharge/sys_level') - > name('sys_level'); //获取充值档位
// Route::get('recharge/routine', 'user.UserRecharge/routine') - > name('rechargeroutine'); //小程序充值
// //开通会员
// Route::post('level', 'user.UserLevel/create') - > name('level') - > middleware(BlockerMiddleware::class) - > middleware(
// 	TradeMiddleware::class); //创建订单
// Route::get('level', 'user.UserLevel/index') - > name('levelindex'); //获取会员列表
// Route::get('level/detail/:id', 'user.UserLevel/detail') - > name('levelDetail'); //获取会员详情
// Route::post('level/pay', 'user.UserLevel/pay') - > name('levelPay'); //订单支付