...
|
...
|
@@ -5,6 +5,15 @@ import StudentService from '../../services/StudentService'; |
|
|
|
|
|
const {
|
|
|
SET_PLATFORM,
|
|
|
|
|
|
QUERY_REGISTER_PAGE_INFO_REQUEST,
|
|
|
QUERY_REGISTER_PAGE_INFO_SUCCESS,
|
|
|
QUERY_REGISTER_PAGE_INFO_FAILURE,
|
|
|
|
|
|
QUERY_PROVINCE_REQUEST,
|
|
|
QUERY_PROVINCE_SUCCESS,
|
|
|
QUERY_PROVINCE_FAILURE,
|
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
|
|
export function setPlatform(platform) {
|
...
|
...
|
@@ -13,3 +22,147 @@ export function setPlatform(platform) { |
|
|
payload: platform,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function queryRegisterPageInfoRequest() {
|
|
|
return {
|
|
|
type: QUERY_REGISTER_PAGE_INFO_REQUEST
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function queryRegisterPageInfoSuccess(pageInfo) {
|
|
|
return {
|
|
|
type:QUERY_REGISTER_PAGE_INFO_SUCCESS,
|
|
|
payload:pageInfo
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function queryRegisterPageInfoFailure(error) {
|
|
|
return {
|
|
|
type:QUERY_REGISTER_PAGE_INFO_FAILURE,
|
|
|
payload:error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function queryProvinceRequest() {
|
|
|
return {
|
|
|
type: QUERY_PROVINCE_REQUEST
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function queryProvinceSuccess(pageInfo) {
|
|
|
return {
|
|
|
type:QUERY_PROVINCE_SUCCESS,
|
|
|
payload:pageInfo
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function queryProvinceFailure(error) {
|
|
|
return {
|
|
|
type:QUERY_PROVINCE_FAILURE,
|
|
|
payload:error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getRegisterPageInfo() {
|
|
|
return (dispatch, getState) => {
|
|
|
dispatch(queryRegisterPageInfoRequest());
|
|
|
let {app, student} = getState();
|
|
|
|
|
|
Promise.all([
|
|
|
new StudentService(app.host).verifiedStudentTotal(),
|
|
|
new StudentService(app.host).getEducationLevelList(),
|
|
|
]).then(result => {
|
|
|
let studentTotal = result[0];
|
|
|
let educationLevelList = result[1];
|
|
|
let schoolYearList = [];
|
|
|
let registerPageCells = processRegisterPageInfo();
|
|
|
for (let i = 0; i < 8; i++) {
|
|
|
schoolYearList.push((new Date()).getFullYear() - i +'');
|
|
|
}
|
|
|
dispatch(queryRegisterPageInfoSuccess({studentTotal,educationLevelList,schoolYearList,registerPageCells}));
|
|
|
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(queryRegisterPageInfoFailure(error));
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getProvince() {
|
|
|
return (dispatch, getState) => {
|
|
|
dispatch(queryProvinceRequest());
|
|
|
let {app, student} = getState();
|
|
|
|
|
|
return new StudentService(app.host).getProvince()
|
|
|
.then(result => {
|
|
|
console.log('getProvince');
|
|
|
console.log(result);
|
|
|
//省份待处理
|
|
|
dispatch(queryProvinceSuccess());
|
|
|
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(queryProvinceFailure(error));
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function processRegisterPageInfo() {
|
|
|
let registerCellList = [
|
|
|
{
|
|
|
type: 'name',
|
|
|
title: '真实姓名',
|
|
|
placeholderText: '请输入您的真实姓名',
|
|
|
text: '',
|
|
|
touchAction: false,
|
|
|
},
|
|
|
{
|
|
|
type: 'id',
|
|
|
title: '身份证号',
|
|
|
placeholderText: '请输入您身份证号码',
|
|
|
text: '',
|
|
|
touchAction: false,
|
|
|
},
|
|
|
{
|
|
|
type: 'province',
|
|
|
title: '学校省份',
|
|
|
placeholderText: '请选择省份',
|
|
|
text: '',
|
|
|
touchAction: true,
|
|
|
},
|
|
|
{
|
|
|
type: 'school',
|
|
|
title: '学校名称',
|
|
|
placeholderText: '请选择您的所在学校',
|
|
|
text: '',
|
|
|
touchAction: true,
|
|
|
},
|
|
|
{
|
|
|
type: 'education',
|
|
|
title: '当前学历',
|
|
|
placeholderText: '请选择您的学历',
|
|
|
text: '',
|
|
|
touchAction: true,
|
|
|
},
|
|
|
{
|
|
|
type: 'years',
|
|
|
title: '入学年份',
|
|
|
placeholderText: '请选择您的入学年份',
|
|
|
text: '',
|
|
|
touchAction: true,
|
|
|
}];
|
|
|
return registerCellList;
|
|
|
}
|
|
|
|
|
|
export function clickRegisterInfoCell(registerCellInfo) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, student} = getState();
|
|
|
let {registerPageInfo} = student;
|
|
|
return null;
|
|
|
switch (registerCellInfo.get('type')) {
|
|
|
case 'province':{
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
} |
...
|
...
|
|