import httpRequest from '@/module/request/http-request.js'
import ipConfig from '@/config/ip.config.js'

const api = {
	getAccountUrl: ipConfig.api_app + '/user/getUserInfo',
	getVipUrl: ipConfig.api_app + '/vip/getVipInfo',
	getProfileUrl: ipConfig.api_app + '/user/profile',
	editNickNameUrl: ipConfig.api_app + "/user/rename",
	editProfileUrl: ipConfig.api_app + "/user/editprofile",
	bindPhoneUrl: ipConfig.api_app + "/user/bind-phone",
	bankCardUrl: ipConfig.api_app + "/user/bank",
	setWithdrawalPasswordUrl: ipConfig.api_app + "/withdraw/setPwd",
	updateFeedbackUrl: ipConfig.api_app + "/service/feedback",
	getBalanceTypeUrl: ipConfig.api_app + "/balance/getBalanceType",
	getBalanceListUrl: ipConfig.api_app + "/balance/getBalanceList",
	getGameListUrl: ipConfig.api_app + "/balance/getGameRecord",
	getFAQListUrl: ipConfig.api_app + "/faq/list",
	bindWithdrawAccountUrl: ipConfig.api_app + "/user/bindwithdrawaccount",
	saveUinfo: ipConfig.api_app + "/fbclick/saveInfo",
	getFbInfo: ipConfig.api_app + "/fbclick/getFbInfo",
	getQuestions: ipConfig.api_app + "/customer/get",
	questionFail: ipConfig.api_app + "/customer/fail",
	questionSuccess: ipConfig.api_app + "/customer/success",
	questionIndex: ipConfig.api_app + "/customer/index",
}

export const getQuestionsApi = (id = 0) => {
	return httpRequest.post({
		url: api.getQuestions,
		data: {
			languageType: 'EN',
			questionId: id
		}
	})
}
export const questionFailApi = (params) => {
	return httpRequest.post({
		url: api.questionFail,
		data: params
	})
}
export const questionSuccessApi = (params) => {
	return httpRequest.post({
		url: api.questionSuccess,
		data: params
	})
}
export const questionIndexApi = (id = '') => {
	return httpRequest.post({
		url: api.questionIndex,
		data: {
			questionId: id,
			languageType: 'EN'
		}
	})
}
export const getFbInfoApi = () => {
	return httpRequest.get({
		url: api.getFbInfo,
		data: {}
	})
}
export const saveUinfoApi = (params) => {
	return httpRequest.post({
		url: api.saveUinfo,
		data: params
	})
}
/**
 * 获取个人中心数据
 */
export const getAccountApi = (params) => {
	return httpRequest.post({
		url: api.getAccountUrl,
		data: params
	})
}

/**
 * 获取用户详细信息
 */
export const getProfileApi = (params) => {
	return httpRequest.post({
		url: api.getProfileUrl,
		data: params
	})
}

/**
 * 修改用户名
 */
export const editNickNameApi = (params) => {
	return httpRequest.post({
		url: api.editNickNameUrl,
		data: params
	})
}

/**
 * 修改用户详细信息
 */
export const editProfileApi = (params) => {
	return httpRequest.post({
		url: api.editProfileUrl,
		data: params
	})
}


/**
 * 绑定手机号
 */
export const bindPhoneApi = (params) => {
	return httpRequest.post({
		url: api.bindPhoneUrl,
		data: params
	})
}


/**
 * 绑定银行卡
 */
export const bankCardApi = (params) => {
	return httpRequest.post({
		url: api.bankCardUrl,
		data: params
	})
}

/**
 * 绑定提现账号
 */
export const bindWithdrawAccountApi = (params) => {
	return httpRequest.post({
		url: api.bindWithdrawAccountUrl,
		data: params
	})
}


/**
 * 设置提现密码
 */

export const setWithdrawalPasswordApi = (params) => {
	return httpRequest.post({
		url: api.setWithdrawalPasswordUrl,
		data: params
	})
}

/**
 * 获取Feedback 更新时间
 */
export const updateFeedbackApi = (params) => {
	return httpRequest.post({
		url: api.updateFeedbackUrl,
		data: params
	})
}

/**
 * 获取余额类型 
 */
export const getBalanceTypeApi = (params) => {
	return httpRequest.post({
		url: api.getBalanceTypeUrl,
		data: params
	})
}

/**
 * 获取余额记录 
 */
export const getBalanceListApi = (params) => {
	return httpRequest.post({
		url: api.getBalanceListUrl,
		data: params
	})
}


/**
 * 获取游戏记录 
 */
export const getGameListApi = (params) => {
	return httpRequest.post({
		url: api.getGameListUrl,
		data: params
	})
}

/**
 * 获取FAQ列表 
 */
export const getFAQListApi = (params) => {
	return httpRequest.post({
		url: api.getFAQListUrl,
		data: params
	})
}