import axios, {uri} from "./api.config.js"

export const baseUrl = uri
export const baseImgUrl = uri + '/admin'

export const codeGetOpenID = data => axios.post('/tool/wx/getOpenidByCode',data, true, 'application/x-www-form-urlencoded;charset=utf-8')

export const loginByOpenid = data => axios.post('/app/user/loginByOpenid',data, true, 'application/x-www-form-urlencoded;charset=utf-8')

export const sendSmsCode = data => axios.post('/tool/sms/sendSmsCode',data, true, 'application/x-www-form-urlencoded;charset=utf-8')

export const loginByPassword = data => axios.post('/app/user/loginByPassword',data)

export const updateUserById = data => axios.post('/app/user/updatePlayletUser',data)

export const updatePasswordByCode = data => axios.post('/app/user/updatePasswordByCode',data)

export const getBannerList = data => axios.post('/app/banner/getBannerList',data)

export const getMessageList = data => axios.post('/app/message/getMessageList',data)

export const getMessagePage = (pageNum, pageSize, data) => axios.post(`/app/message/getMessagePage?pageNum=${pageNum}&pageSize=${pageSize}`,data)

export const getCustomerList = data => axios.post('/app/customer/getCustomerList',data) 

export const getProjectList = data => axios.post('/app/project/getProjectList',data)
// 短剧视频接口
export const getItemList = (pageNum, pageSize, data) => axios.post(`/app/item/getItemList?pageNum=${pageNum}&pageSize=${pageSize}`,data)
// 获取剧场类型
export const getTypeList = data => axios.post('/app/type/getTypeList',data)


export const record = {
	// 收益统计
	statistics: data => axios.post('/app/record/statistics',data),
	// 收益时间统计
	statisticsTime: data => axios.post('/app/record/statistics/time',data),
	// 收益统计时间分类
	statisticsTimeType: data => axios.post('/app/record/statistics/time/type',data),
	
	getRecordList: (pageNum, pageSize, data) => axios.post(`/app/record/getRecordList?pageNum=${pageNum}&pageSize=${pageSize}`,data)
}

export const feedbackAdd = data => axios.post('/app/feedback/add',data)

export const feedbackList = (pageNum, pageSize, data) => axios.post(`/app/feedback/getFeedBackList?pageNum=${pageNum}&pageSize=${pageSize}`,data)


export const getTaskList = (pageNum, pageSize, data) => axios.post(`/app/task/getTaskList?pageNum=${pageNum}&pageSize=${pageSize}`,data)

// 提现账号管理
export const withdraw = {
	getInfo: data => axios.post('/app/account/list',data, true, 'application/x-www-form-urlencoded;charset=utf-8'),
	addAccount: data => axios.post('/app/account/add',data),
	editAccount: data => axios.post('/app/account/edit',data),
}

export const codeIvSignRegister = data => axios.post('/account/login', data)

export const getUserInfo = data => axios.post('/account/getAccount', data)

export const updateUserInfo = data => axios.post('/account/updateById', data)

export const storeList = _ => axios.post('/dept/list')

export const getMainData = data => axios.post('/main/getMainresource', data)

export const getPayList = data => axios.post('/setmenu/list', data)

export const saveCoin =  data => axios.post('/currencyRecord/saveCurry', data)

export const getCoin =  data => axios.post('/currencyRecord/withdraw', data)

export const coinRecord = data => axios.post('/account/currencyRecord', data)

export const saveIntegral = data => axios.post('/integralRecord/saveIntegral', data)

export const integralRecord = data => axios.post('/integralRecord/page', data)

export const productList = data => axios.post('/product/page', data)

export const productInfo = data => axios.post('/product/getById', data)

export const productCollet = data => axios.post('/product/collect', data)

export const productUnCollect = data => axios.post('/account/delCollect', data)

export const productApply = data => axios.post('/product/apply', data)

export const collectList = data => axios.post('/account/myCollect', data)

export const exchangeRecord = data => axios.post('/productRecord/page', data)

export const getDict = dictType => axios.get(`/dict/data/type/${dictType}`)

export const getStatistics = data => axios.post('/integralRecord/statistics', data)

export const payMoney = data => axios.post('/setmenu/pay', data)

export const suggestionAdd = data => axios.post('/suggestion/add', data)



// export const login = {
// 	// 查房登录
// 	type1: data => axios.post('/bam/login',data),
// 	type2: data => axios.post('/clean/login',data),
// 	type3: data => axios.post('/project/login',data)
// }

// export const userInfo = {
// 	info1: _ => axios.get('/bam/admin/getByToken'),
// 	info2: _ => axios.get('/clean/staff/getByToken'),
// 	info3: _ => axios.get('/project/staff/getByToken'),
// 	// 保洁--根据token查询本人房间分组
// 	cleanInfoData: _ => axios.get('/clean/staff/getByGroup'),
// 	// 获取平均保洁时长
// 	getAvgClean: _ => axios.get('/clean/staff/getAvgClean'),
// 	// 修改上下班状态/clean/staff/offWork
// 	offWork: workStatus => axios.put('/clean/staff/offWork?workStatus='+workStatus),
// 	// 工程端本月累计完成工单和获取维修人员本月平均维修时长(返回毫秒值)
// 	getAvgProject: _ => axios.get('/project/staff/getAvgProject'),
// 	// 今日分房
// 	getTodayDispathRoom: _ => axios.get('/clean/staff/getByRoomDistribute')
	
// }

// 更改密码
// export const changePwd = {
// 	c1: data => axios.put(`/bam/admin/updatePw?oldPw=${data.oldPw}&pw=${data.pw}&rePw=${data.rePw}`,data),
// 	c2: data => axios.put(`/clean/staff/updatePw?oldPw=${data.oldPw}&pw=${data.pw}&rePw=${data.rePw}`,data),
// 	c3: data => axios.put(`/project/staff/updatePw?oldPw=${data.oldPw}&pw=${data.pw}&rePw=${data.rePw}`,data)
// }

// export const notice = {
// 	list: data => axios.get('/clean/notice/page', data),
// 	info: id => axios.get(`/clean/notice/${id}`),
// 	projectList: data => axios.get('/project/notice/page', data),
// 	projectInfo: id => axios.get(`/project/notice/${id}`),
// 	adminList: data => axios.get('/bam/index/pageIndexNotice', data),
// 	adminInfo: id => axios.get(`/bam/notice/getItem/${id}`),
// 	// 满房提醒
// 	roomalarm: data => axios.get('/jy/roomalarm/list/page', data),
// 	roomalarmRead: id => axios.post('/jy/roomalarm/read/'+id, {}),
// 	// 新增公告
// 	addHotelNotice: (hotelId, data) => axios.post('/bam/notice/addHotelNotice?hotelId='+hotelId, data),
// 	// 发布公告
// 	pushHotelNotice: (hotelId, id) => axios.put('/bam/notice/pushHotelNotice?hotelId='+hotelId+'&id='+id),
// 	// 获取公告标签列表
// 	getLabelList: hotelId => axios.get('/bam/label-manager/list?hotelId='+hotelId+'&type=2'),
// 	// 获取人员标签
// 	getMemberLabelList: hotelId => axios.get('/bam/label-manager/list?hotelId='+hotelId+'&type=1'),
// }