const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
let settledApiFun = function(vm){
	
	/* 查询用户基本信息 */
	let getSettleBaseInfo = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/get-settled-info', params);
	/* 获取认证区域信息 */
	let getSettleArea = async (params = {}) => await vm.$u.get(ucenterApiUrl + '/v1/settled/area', params);
	/* 提交用户基本信息 */
	let submitSettleBaseInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/save-info', params);
	
	/* 校验身份证正面 */
	let checkSettleIDCardFront = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/card-front', params);
	
	/* 校验身份证反面 */
	let checkSettleIDCardBack = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/card-back', params);
	
	/* 提交用户资料 */
	let submitSettleFileInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/submit-info', params);
	
	/* 缴纳保证金 */
	let paySettleDeposit = async (params = {}) => await vm.$u.post(ucenterApiUrl + '/v1/settled/pay-deposit' , params,{'content-type': 'application/x-www-form-urlencoded'});
	
	let getSettleDepositResult = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/check-oid', params,{'content-type': 'application/x-www-form-urlencoded'});
	
	/* 校验银行卡 */
	// let checkSettleBank = async (params = {}) => await vm.$u.get('/wxh-site-rest/rest/register/verifyBankCard', params);
	
	/* 校验支付宝 */
	// let checkSettleAlipay = async (params = {}) => await vm.$u.get('/wxh-site-rest/rest/register/verifyAlipayAccount', params);
	
	/* 提交认证资料 */
	let checkSettleSignInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/check-sign-info', params,{'content-type': 'application/x-www-form-urlencoded'});
	
	const settledApi = {
		getSettleBaseInfo,
		getSettleArea,
		submitSettleBaseInfo,
		checkSettleIDCardFront,
		checkSettleIDCardBack,
		submitSettleFileInfo,
		paySettleDeposit,
		getSettleDepositResult,
		// checkSettleBank,
		// checkSettleAlipay,
		checkSettleSignInfo
	}
	return settledApi
}

module.exports =  {
	settledApiFun
}