/**
 * zdx
 * moduleName: 提现模块
 */

import {
	request
} from '../index.js'


// 添加前置条件
const accountsCreate = () => {
	return request({
		url: 'withdraws/accounts/create'
	})
}

// 添加银行卡
const withdrawsAccounts = (data) => {
	return request({
		url: 'withdraws/accounts',
		method: 'POST',
		data: data
	})
}

// 银行卡列表
const withdrawsAccountsList = (data) => {
	return request({
		url: 'withdraws/accounts',
		method: 'get',
		data: data
	})
}

// 编辑银行卡前置
const accountsCreateEdit = (id) => {
	return request({
		url: 'withdraws/accounts/'+id+'/edit'
	})
}

// 编辑银行卡
const withdrawsAccountsEdits = (data) => {
	return request({
		url: 'withdraws/accounts/'+data.bank_account_id,
		method: 'PUT',
		data: data
	})
}

// 删除银行卡
const withdrawsAccountsDelete = (id) => {
	return request({
		url: 'withdraws/accounts/'+id,
		method: 'DELETE'
	})
}

// 提现前置记录
const withdrawsIndexCreate = () => {
	return request({
		url: 'withdraws/index/create'
	})
}

// 提现接口
const withdrawsIndex = (data) => {
	return request({
		url: 'withdraws/index',
		method: 'POST',
		data: data
	})
}

// 提现记录
const withdrawsIndexLists = (data) => {
	return request({
		url: 'withdraws/index',
		method: 'get',
		data: data
	})
}

// 积分记录
 const userAccoutScores = (data) => {
 	return request({
 		url: 'user/account/scores',
 		method: 'get',
 		data: data
 	})
 }
 
 // 通证转红包前置
 const cashsCreate = () => {
 	return request({
 		url: 'user/account/cashs/create',
 		method: 'get'
 	})
 }
 
 // 通证转红包
const accountCashs = (data) => {
 	return request({
 		url: 'user/account/cashs',
 		method: 'POST',
 		data: data
 	})
 }
export {
	accountsCreate,
	withdrawsAccounts,
	withdrawsAccountsList,
	accountsCreateEdit,
	withdrawsAccountsEdits,
	withdrawsAccountsDelete,
	withdrawsIndexCreate,
	withdrawsIndex,
	withdrawsIndexLists,
	userAccoutScores,
	accountCashs,
	cashsCreate
}
