import request from '@/utils/request'

// 获取充值记录,表格数据
export function getTableData(forData) {
	let data = new FormData()
	data.append('page', forData.page)
	data.append('rows', forData.rows)
	if (typeof forData.h_type != 'undefined') {
		data.append('h_type', forData.h_type)
	}
	return request({
		url: '/houselist.action',
		method: 'post',
		data
	})
}

// 添加房型
export function addHouseType(forData) {
  let data = {
  	h_type: forData.h_type,
  	price: forData.price,
  	number: forData.number
  };

	return request({
		url: '/houseinsert.action',
		method: 'post',
		data
	})
}

// 修改房型
export function modifyHouseType(forData) {
  let data = {
    id: forData.id,
  	h_type: forData.h_type,
  	price: forData.price,
  	number: forData.number
  };

	return request({
		url: '/houseupdate.action',
		method: 'post',
		data
	})
}

// 修改房型
export function delHouseType(forData) {
  let data = new FormData()
  data.append('id', forData.id)

	return request({
		url: '/housedel.action',
		method: 'post',
		data
	})
}
