import request, {
	get,
	post,
	deleteMethod,
	putMethod
} from "./request.js"

// 字典
export const getSystemDictData = (data) => {
	return get('/system/dict/data/list', data)
}

// =======公告列表========
export const getResidentNoticeList = (data) => {
	return get('/api/resident/notice/list', data)
}
// 我的房屋列表
export const getMyHouseList = (data) => {
	return get('/api/resident/my/house/list', data)
}
// 提交房屋注册认证申请
export const myHouseApply = (data) => {
	return post('/api/resident/my/house/apply', data)
}
// 查询小区列表
export const getVillageList = (data) => {
	return get('/api/resident/village/list', data)
} // 查询楼栋列表
export const getHouseBuildings = (data) => {
	return get('/api/resident/house/buildings', data)
}
// 查询单元列表
export const getHouseUnits = (data) => {
	return get('/api/resident/house/units', data)
}
// 查询楼层列表
export const getHouseFloors = (data) => {
	return get('/api/resident/house/floors', data)
}
// 查询户号列表
export const getHouseHouses = (data) => {
	return get('/api/resident/house/houses', data)
}
// 房屋绑定手机获取验证码
export const getHouseAuthSendSmsCode = (data) => {
	return post('/api/resident/auth/sendSmsCode', data)
}
// 房屋详情
export const getMyHouseDetail = (data) => {
	return get(`/api/resident/my/house/${data.id}`, data)
}
// 删除房屋
export const deleteMyHouse = (data) => {
	return deleteMethod(`/api/resident/my/house/${data.id}`, data)
}
// 设置默认房屋
export const setMyHouseDefault = (data) => {
	return post(`/api/resident/my/house/default`, data)
}

// 添加房屋与业主关系-下拉数据
export const getHouseDataList = (data) => {
	return get(`/api/resident/my/house/dataList`, data)
}

// 获取当前用户登录信息
export const getUserProfile = (data) => {
	return get(`/api/resident/user/profile`, data)
}
// 发送新手机号验证码
export const getAuthSendSmsCode = (data) => {
	return post(`/api/resident/auth/sendSmsCode`, data)
}
// 更改手机号
export const getUserChangePhone = (data) => {
	return post(`/api/resident/user/changePhone`, data)
}
// 获取消息通知开关
export const getUserNotify = (data) => {
	return get(`/api/resident/user/notify`, data)
}
// 更新消息通知开关
export const changeUserNotify = (data) => {
	return post(`/api/resident/user/notify`, data)
} // 修改密码(需登录)
export const authChangePassword = (data) => {
	return post(`/api/resident/auth/changePassword`, data)
} // 退出登录
export const authLogout = (data) => {
	return post(`/api/resident/auth/logout`, data)
}
// 注销账号
export const authDeleteAccount = (data) => {
	return post('/api/resident/auth/cancelAccount', data)
}
// 编辑房屋
export const upDateMyHouse = (data) => {
	return putMethod(`/api/resident/my/house/${data.id}`, data)

}

//  =========问卷调查=========
// 问卷列表
export const getQuestionnaireList = (data) => {
	return get('/api/resident/questionnaire/list',data)
}
// 问卷详情
export const getQuestionnaireDetail = (id,data) => {
	return get(`/api/resident/questionnaire/${id}`,data)
}
// 提交问卷
export const submitQuestionnair = (id,data) => {
	return post(`/api/resident/questionnaire/submit/${id}`, data)
}
// =====投诉意见=======
// 获取投诉类型
export const getComplainType = (data) => {
	return post('/complain/getComplainType',data)
}
// 获取投诉列表
export const getComplainList = (data) => {
	return get('/complain/getComplainList',data)
}
// 提交投诉建议
export const addComplain = (data) => {
	return post('/complain/add',data)
}
// 投诉详情
export const getComplainDetail = (data) => {
	return get('/complain/detail',data)
}
// 联系物业
export const getManagePhoneData = (data) => {
	return get('/api/manage/banner/getManagePhone',data)
}

// 修改身份证照片
export const uploadFileUploadImage = (data) => {
	return post(`/api/resident/file/uploadImage`, data)
}

// 水电表
export const getTopUpSelectByResident = (data) => {
	console.log(data);
	return get(`/api/topUp/selectByResident/${data.residentUserId}`, data)
}




// 账单明细列表
export const getTopUpDetails = (data) => {
	return post(`/api/topUp/billDetails/list`, data)
}
// 账单按月汇总
export const getTopUpDetailsByMonth = (data) => {
	return post(`/api/topUp/billDetails/listByMonth`, data)
}




// 绑定设备
export const getTopUpBindDevice = (data) => {
	return post(`/api/topUp/bindDevice/${data.deviceCode}/${data.residentUserId}/${data.deviceType}`, data)
}
// 充值调用
// /${data.rechargeAmount}/${data.type}/${data.deviceCode}
export const getTopUp = (data) => {
	return post(`/api/topUp`, data)
}
export const getopenIdByCode = (data) => {
	return get(`/api/topUp/getOpenIdByCode?code=${data.code}`, data)
}

// 银联支付下单
export const getUnionPayTn = (data) => {
	return post('/api/topUp/unionPay/getTn', data)
}
// 获取日照银行小程序拉起参数
export const getBankMiniProgramParams = (data) => {
	return post('/api/pay/yidang/create', data)
}
// 缴费记录查询
export const getTopupRecordWithStat = (data) => {
	return get(
		`/api/topUp/topupRecordWithStat?residentUserId=${data.residentUserId}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
		data)
}
export const postInsertOpenId = (data) => {
	return post(`/api/resident/auth/insertOpenId`, data)
}
export const postSubscribeAuth = (data) => {
	return post(`/api/wx/subscribeAuth/auth`, data)
}

// 添加车辆
export const postCar = (data) => {
	return post(`/api/resident/car`, data)
}
// 修改车辆
export const putCar = (data) => {
	return putMethod(`/api/resident/car`, data)
}

// 获取车辆列表
export const getMyCarList = (data) => {
	return get(`/api/resident/car/myList`, data)
}
// 获取车位列表
export const getCarList = (data) => {
	return get(`/api/resident/car/list`, data)
}
// 获取车辆详细信息
export const getCarDetail = (data) => {
	return get(`/api/resident/car/${data.id}`, data)
}
// 删除车辆信息
export const deleteCar = (data) => {
	return deleteMethod(`/api/resident/car/${data.carId}`, data)
}
// 获取用户车位绑定列表
export const getUserParkingSpaceList = (data) => {
	return get(`/api/resident/car/parking/list`, data)
}

// 获取区域列表
export const getResidentCarAreaManageAreaListByVillageId = (data) => {
	return get(`/ResidentCarAreaManage/areaListByVillageId`, data)
}
// 根据区域id获得车位列表
export const getResidentCarAreaManageParkingListByAreaId = (data) => {
	return get(`/ResidentCarAreaManage/parkingListByAreaId`, data)
}
// 绑定车位
export const postCarBind = (data) => {
	return post(`/api/resident/car/bind`, data)
}
// 获取用户下车位绑定信息
// export const getCarList = (data) => {
// 	return get(`/api/resident/car/list`, data)
// }
// 删除车位
export const deleteParking = (data) => {
	return deleteMethod(`/ResidentCarAreaManage/parking/${data.parkingId}`, data)
}
// 车位详情
export const getParkingDetail = (data) => {
	return get(`/api/resident/car/parking/detail/${data.id}`, data)
}
// 解绑车辆
export const rebindCar = (data) => {
	return post(`/ResidentCarAreaManage/rebind`, data)
}
// 获取业主列表
export const getOwnerList = (data) => {
	return get('/api/resident/car/bind/ResidentList', data)
}

// 查询版本信息
export const getAppVersion = (platform, channel,appChannel) => {
	return get(`/api/app/version/${platform}/${channel}/${appChannel}`)
}
// 检查是否需要更新
export const checkAppUpdate = (data) => {
	return post(`/api/app/checkUpdate`, data)
}
// 记录更新日志
export const postUpdateLog = (data) => {
	return post(`/api/app/updateLog`, data)
}

// ===========巡检记录========
// 列表
export const getInspectionList = (data) =>{
	return get('/api/resident/inspection/list',data)
}
// 详情
export const inspectionDetails = (data) =>{
	return get(`/api/resident/inspection/${data.id}`,data)
}

// =======公区收益=========
// 列表 
export const getRevenueList = (data) =>{
	return get('/api/resident/revenueNotice/list',data)
}
// 详情
export const revenueDetails = (data) =>{
	return get(`/api/resident/revenueNotice/${data.id}`)
}

// =======积分相关=========
// 获取积分余额
export const getPointsBalance = (data) => {
	return get('/api/resident/points/balance', data)
}
// 获取积分商城商品列表
export const getPointsMallList = (data) => {
	return get('/api/resident/points/mall/list', data)
}
// 积分兑换
export const postPointsExchange = (data) => {
	return post('/api/resident/points/mall/exchange', data)
}
// 获取积分明细列表
export const getPointsRecordList = (data) => {
	return get('/api/resident/points/record/list', data)
}
// 获取积分兑换订单列表
export const getPointsOrderList = (data) => {
	return get('/api/resident/points/order/list', data)
}