import request from '../utils/request'
import Qs from 'qs';

//根据用户名和手机号查询人员信息
export function findByNameAndPhone(params) {
	return request({
		url: '/mobile/personInfoApi/findByNameAndPhone',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//验证验证码并登录
export function validateCode(params) {
	return request({
		url: '/mobile/personInfoApi/validateCode',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//用户登录提交信息
export function save(params) {
	return request({
		url: '/mobile/personInfoApi/save',
		data: Qs.stringify(params),
		method: 'post',
	})
}


//==================场景注册==================

//获取场景列表
export function getSceneList() {
	return request({
		url: '/mobile/scene/sceneList',
		data: Qs.stringify(),
		method: 'post',
	})
}

//获取区域列表
export function getRegionList(regionName) {
	return request({
		url: '/mobile/scene/regionList',
		data: Qs.stringify({
			regionName: regionName
		}),
		method: 'post',
	})
}

//根据区域获取公司列表
export function getCompanyList(params) {
	return request({
		url: '/mobile/scene/companyListByRegion',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//根据公司名称获取公司列表
export function getCompanyListBySeach(params) {
	return request({
		url: '/mobile/scene/companyBySceneAndName',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//按照场景查询用户角色列表
export function getPersonRoleListByScene(sceneId) {
	return request({
		url: '/mobile/scene/personRoleListByScene',
		data: Qs.stringify({
			sceneId: sceneId
		}),
		method: 'post',
	})
}

//按照公司id查询结构列表-一级
export function getCompanyStructureList(companyId) {
	return request({
		url: '/mobile/scene/companyStructureList',
		data: Qs.stringify({
			companyId: companyId
		}),
		method: 'post',
	})
}

//按照机构名称查询结构列表-多级
export function getCompanyStructureByName(companyId, positionName) {
	return request({
		url: '/mobile/scene/companyStructureByName',
		data: Qs.stringify({
			companyId: companyId,
			positionName: positionName
		}),
		method: 'post',
	})
}

//养老机构获取管理机构列表
export function getServiceCompanyIdList() {
	return request({
		url: '/mobile/companyInfoApi/serviceCompanyIdList',
		data: Qs.stringify({}),
		method: 'post',
	})
}

//提交注册
export function register(params) {
	return request({
		url: '/mobile/personInfoApi/register',
		data: Qs.stringify(params),
		method: 'post',
	})
}
