实名认证和职业认证

dev_auth
caishi 5 years ago
parent b9180e3b37
commit b3f43afa43

@ -4,6 +4,7 @@ import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd'
import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal'
import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal'
import AccountBasicEditItem from './AccountBasicEditItem';
import axios from 'axios'
import { identityMap } from './AccountBasic'
const RadioGroup = Radio.Group;
@ -282,7 +283,9 @@ class AccountBasic extends Component {
getDepartments=(e,flag)=>{
let arr=this.state.schoolList.filter(function(item){
return item.name == e;
if(item.name.indexOf(e) > -1){
return item.name;
}
});
if (!arr[0]) {
if (!e) {
@ -354,20 +357,7 @@ class AccountBasic extends Component {
})
}
// 切换职称
changeJob=(e)=>{
this.setState({
identity:e
})
let {basicInfo}=this.props;
if(basicInfo){
this.props.form.setFieldsValue({
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}
}
addOrgSuccess = (name) => {
// const schoolList = this.state.schoolList.slice(0)
@ -407,6 +397,19 @@ class AccountBasic extends Component {
}
callback(`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`);
}
// 切换职称
changeJob=(e)=>{
this.setState({
identity:e
})
let {basicInfo}=this.props;
if(basicInfo){
this.props.form.setFieldsValue({
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}
}
render() {
let{
@ -422,10 +425,17 @@ class AccountBasic extends Component {
}=this.state;
const { getFieldDecorator } = this.props.form;
let{ basicInfo }=this.props
// 已职业认证的账户不能修改职业,学校/单位,院系/部门产品还未确定先默认为false--可以更改
// basicInfo && basicInfo.professional_certification == "certified"
const professionalFlag = false;
let common = {
changeJob:this.changeJob,
filterList:this.filterList,
changeList:this.changeList,
searchDepartment:this.searchDepartment,
changeDepartment:this.changeDepartment,
showApplyForAddOrgModal:this.showApplyForAddOrgModal,
showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal
}
// 已职业认证的账户不能修改职业,学校/单位,院系/部门true为disable
const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
// form合并了
const propsWithoutForm = Object.assign({}, this.props)
@ -599,177 +609,22 @@ class AccountBasic extends Component {
<City></City>
)}
</Form.Item>
<div className="clearfix">
<Form.Item
label="职业"
className="formItemInline fl"
>
{getFieldDecorator('job', {
rules: [{
initialValue:"teacher",
required: true,
message: '请先选择职业',
}],
})(
<Select style={{width:"190px",marginRight:"20px"}} onChange={this.changeJob} disabled={professionalFlag}>
<Option value="teacher">教师</Option>
<Option value="student">学生</Option>
<Option value="professional">专业人士</Option>
</Select>
)}
</Form.Item>
{
identity && identity=="student" &&
<Form.Item
label=""
className="formItemInline fl"
style={{ 'margin-top': '3px'}}
// style={{display:identity && identity=="student" ? "block":"none"}}
>
{getFieldDecorator('student_No', {
rules: [{
required: true,
message: '请先输入学号',
}],
})(
<Input type="text" placeholder="请输入学号" style={{width:"190px"}} disabled={professionalFlag}></Input>
)}
</Form.Item>
}
{
identity && identity=="teacher" &&
<Form.Item
label=""
className="formItemInline fl"
// style={{display:identity && identity=="teacher" ? "block":"none"}}
>
{getFieldDecorator('job1', {
rules: [{
initialValue:"教授",
required: true,
message: '请先选择职称',
}],
})(
<Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="教授">教授</Option>
<Option value="副教授">副教授</Option>
<Option value="讲师">讲师</Option>
<Option value="助教">助教</Option>
</Select>
)}
</Form.Item>
}
{
identity && identity=="professional" &&
<Form.Item
label=""
className="formItemInline fl mb0"
// style={{display:identity && identity=="professional" ? "block":"none"}}
>
{getFieldDecorator('job2', {
rules: [{
initialValue:"企业管理者",
required: true,
message: '请先选择职称',
}],
})(
<Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="企业管理者">企业管理者</Option>
<Option value="部门管理者">部门管理者</Option>
<Option value="高级工程师">高级工程师</Option>
<Option value="工程师">工程师</Option>
<Option value="助理工程师">助理工程师</Option>
</Select>
)}
</Form.Item>
}
</div>
<Form.Item
label="学校/单位"
className="formItemInline mb0"
>
{getFieldDecorator('org', {
rules: [{
// initialValue: this.state.cityDefaultValue,
// type: 'array',
required: true,
message: '请先选择学校/单位',
// 做不了输入时和submit时都会执行这里
// validator: (rule, value, callback) => {
// if (this.this_school_id) {
// callback();
// return;
// }
// callback('请先选择学校/单位');
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.filterList} onChange={this.changeList} disabled={professionalFlag}>
{
filterSchoolList && filterSchoolList.map((item,key)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>)
})
}
</AutoComplete>
)}
</Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
</span>
</div>
}
<Form.Item
label="院系/部门"
className="formItemInline mb0"
style={{ 'margin-top': '10px'}}
>
{getFieldDecorator('org2', {
rules: [{
// initialValue: this.state.cityDefaultValue,
// type: 'array',
required: true,
message: '请先选择院系/部门',
// validator: (rule, value, callback) => {
// if (this.this_department_id) {
// callback();
// return;
// }
// callback('请先选择院系/部门');
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment} disabled={professionalFlag}>
{
filterDepartments && filterDepartments.map((item,key)=>{
return(
<Option value={item.name} key={item.name}>{item.name}</Option>
)
})
}
</AutoComplete>
)}
</Form.Item>
{
filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && !this.state.department_id
&& (!departments || departments.length == 0) )) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddChildOrgModal}>申请新增</span>
</span>
</div>
}
<AccountBasicEditItem
identity={identity}
getFieldDecorator = {getFieldDecorator}
professionalFlag = {professionalFlag}
basicInfo = {basicInfo}
{...this.props}
{...this.state}
{...common}
form={this.props.form}
filterSchoolList={filterSchoolList}
filterDepartments={filterDepartments}
departmentsName={departmentsName}
school={school}
department_id={this.state.department_id}
departments={departments}
></AccountBasicEditItem>
{/* htmlType="submit" */}
{/* <Form.Item>
<div className="clearfix mt30 mb30"> */}

@ -0,0 +1,199 @@
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd'
const RadioGroup = Radio.Group;
const Option = Select.Option;
class AccpimtBasicEditItem extends Component {
constructor(props){
super(props);
}
render(){
let {
professionalFlag ,
getFieldDecorator ,
identity ,
filterSchoolList ,
filterDepartments,
departmentsName,
school,
departments,
department_id
} = this.props
return(
<div>
<div className="clearfix mt10">
<Form.Item
label="职业"
className="formItemInline fl"
>
{getFieldDecorator('job', {
rules: [{
initialValue:"teacher",
required: true,
message: '请先选择职业',
}],
})(
<Select style={{width:"190px",marginRight:"20px"}} onChange={(e)=>this.props.changeJob(e)} disabled={professionalFlag}>
<Option value="teacher">教师</Option>
<Option value="student">学生</Option>
<Option value="professional">专业人士</Option>
</Select>
)}
</Form.Item>
{
identity && identity=="student" &&
<Form.Item
label=""
className="formItemInline fl"
style={{ 'margin-top': '3px'}}
// style={{display:identity && identity=="student" ? "block":"none"}}
>
{getFieldDecorator('student_No', {
rules: [{
required: true,
message: '请先输入学号',
}],
})(
<Input type="text" placeholder="请输入学号" style={{width:"190px"}} disabled={professionalFlag}></Input>
)}
</Form.Item>
}
{
identity && identity=="teacher" &&
<Form.Item
label=""
className="formItemInline fl"
// style={{display:identity && identity=="teacher" ? "block":"none"}}
>
{getFieldDecorator('job1', {
rules: [{
initialValue:"教授",
required: true,
message: '请先选择职称',
}],
})(
<Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="教授">教授</Option>
<Option value="副教授">副教授</Option>
<Option value="讲师">讲师</Option>
<Option value="助教">助教</Option>
</Select>
)}
</Form.Item>
}
{
identity && identity=="professional" &&
<Form.Item
label=""
className="formItemInline fl mb0"
// style={{display:identity && identity=="professional" ? "block":"none"}}
>
{getFieldDecorator('job2', {
rules: [{
initialValue:"企业管理者",
required: true,
message: '请先选择职称',
}],
})(
<Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="企业管理者">企业管理者</Option>
<Option value="部门管理者">部门管理者</Option>
<Option value="高级工程师">高级工程师</Option>
<Option value="工程师">工程师</Option>
<Option value="助理工程师">助理工程师</Option>
</Select>
)}
</Form.Item>
}
</div>
<Form.Item
label="学校/单位"
className="formItemInline mb0"
>
{getFieldDecorator('org', {
rules: [{
// initialValue: this.state.cityDefaultValue,
// type: 'array',
required: true,
message: '请先选择学校/单位',
// 做不了输入时和submit时都会执行这里
// validator: (rule, value, callback) => {
// if (this.this_school_id) {
// callback();
// return;
// }
// callback('请先选择学校/单位');
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.props.filterList} onChange={this.props.changeList} disabled={professionalFlag}>
{
filterSchoolList && filterSchoolList.map((item,key)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>)
})
}
</AutoComplete>
)}
</Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.props.showApplyForAddOrgModal}>申请新增</span>
</span>
</div>
}
<Form.Item
label="院系/部门"
className="formItemInline mb0"
style={{ 'margin-top': '10px'}}
>
{getFieldDecorator('org2', {
rules: [{
// initialValue: this.state.cityDefaultValue,
// type: 'array',
required: true,
message: '请先选择院系/部门',
// validator: (rule, value, callback) => {
// if (this.this_department_id) {
// callback();
// return;
// }
// callback('请先选择院系/部门');
// }
}],
})(
<AutoComplete width={400} showSearch onSearch={this.props.searchDepartment} onChange={this.props.changeDepartment} disabled={professionalFlag}>
{
filterDepartments && filterDepartments.map((item,key)=>{
return(
<Option value={item.name} key={item.name}>{item.name}</Option>
)
})
}
</AutoComplete>
)}
</Form.Item>
{
filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && ! department_id
&& (!departments || departments.length == 0) )) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.props.showApplyForAddChildOrgModal}>申请新增</span>
</span>
</div>
}
</div>
)
}
}
export default AccpimtBasicEditItem;

@ -1,15 +1,19 @@
import React, { Component } from "react";
import { message, Icon, Input, Form, Upload} from "antd";
import { message, Icon, Input, Form, Upload,Radio ,Tooltip} from "antd";
import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper"
import { City, getUploadActionUrl, getImageUrl, ImageLayer2, getUploadActionUrlOfAuth } from 'educoder'
import { City, getUploadActionUrl, getImageUrl, ImageLayer2, getUploadActionUrlOfAuth ,ConditionToolTip } from 'educoder'
import '../account/common.css'
import AccountBasicEditItem from '../account/AccountBasicEditItem'
import ApplyForAddOrgModal from './ApplyForAddOrgModal'
import ApplyForAddChildOrgModal from './ApplyForAddChildOrgModal'
import authImg from '../../../images/account/auth.png'
import jobImg from '../../../images/account/job.png'
const { TextArea } = Input;
const RadioGroup = Radio.Group;
const Dragger = Upload.Dragger;
const MAX_NAME_LENGTH = 10
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
@ -26,16 +30,230 @@ function beforeUpload(file) {
}
return isJPG && isLt2M;
}
export function getHiddenName(name) {
if (!name) return ''
let len=parseInt(name.length)-1;
let str="";
for(var i = 0; i < len; i++){ str += "*"; }
const newName = name.substr(0,1)+str;
return newName
}
class RealNameCertificationModal extends Component{
constructor(props){
super(props);
this.state={
identity:"teacher",
departmentsName:undefined,
filterSchoolList:undefined,
filterDepartments :undefined,
school:undefined,
school_id:undefined,
department_id:undefined,
schoolList:undefined,
departments:undefined,
showRealName:true,
}
}
componentDidMount() {
if(this.props.basicInfo){
this.setValue(this.props.basicInfo);
this.getSchoolList(this.props.basicInfo);
}
}
setValue=(basicInfo)=>{
if(basicInfo){
this.props.form.setFieldsValue({
nickname:basicInfo.nickname,
name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name,
sex:String(basicInfo.gender),
job:basicInfo.identity,
org:basicInfo.school_name,
// city:[basicInfo.location,basicInfo.location_city]
})
setTimeout(() => {
// 等显示后再set
this.props.form.setFieldsValue({
job:basicInfo.identity,
student_No:basicInfo.student_id,
org2:basicInfo.department_name,
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}, 100)
//if(basicInfo.nickname){
this.setState({
forDisable: true,
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
realName: basicInfo.name,
identity:basicInfo.identity,
school_id:basicInfo.school_id,
department_id:basicInfo.department_id
})
//}
}
}
getSchoolList=(basicInfo, selectedName)=>{
let url=`/schools/for_option.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
schoolList:result.data.schools
})
if (selectedName) {
let school_id
result.data.schools.reverse().some( item => {
if (item.name == selectedName) {
school_id = item.id
return true;
}
})
this.props.form.setFieldsValue({
org: selectedName
})
this.setState({
school_id,
school: selectedName
}, () => {
this.filterList(selectedName)
})
} else if(basicInfo && basicInfo.school_name){
this.setState({
school:basicInfo.school_name,
filterSchoolList:this.state.schoolList.filter(function(item){
return item.name.indexOf(basicInfo.school_name)>-1;
})
})
this.getDepartments(basicInfo.school_name,false);
}
}
}).catch((error)=>{
console.log(error);
})
}
// 将名字隐藏起来
hideRealName=(name)=>{
this.setState({ realName: name })
const newName = getHiddenName(name)
this.props.form.setFieldsValue({
name: newName
})
return newName
}
getDepartments=(e,flag)=>{
let arr=this.state.schoolList.filter(function(item){
if(item.name.indexOf(e) > -1){
return item.name;
}
});
if (!arr[0]) {
if (!e) {
this.setState({
filterSchoolList: []
})
}
// 没找到学校,清空部门
this.setState({
departments: [],
filterDepartments: [],
departmentsName: '',
school_id: '',
department_id: '',
})
this.this_school_id = ''
this.props.form.setFieldsValue({
org2: ''
})
return;
}
this.props.form.setFieldsValue({
org: arr[0].name
})
this.filterList(e)
// 保存选择的学校id
this.this_school_id = arr[0].id
this.setState({
school_id: arr[0].id,
school:e,
})
this._getDepartments(arr[0].id, flag)
}
_getDepartments = (schoolId, flag, selectedName) => {
let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
departments:result.data.departments,
filterDepartments:result.data.departments
})
if (selectedName) {
let department_id
result.data.departments.reverse().some( item => {
if (item.name == selectedName) {
department_id = item.id
return true;
}
})
this.props.form.setFieldsValue({
org2: selectedName
})
this.setState({
department_id,
// school: selectedName
})
} else if(result.data.departments && result.data.departments.length>0 && flag==true){
// 切换学校后,部门默认选择第一个
this.props.form.setFieldsValue({
org2:result.data.departments[0].name
})
this.setState({
department_id: result.data.departments[0].id
})
}else if(result.data.departments && result.data.departments.length == 0 && flag==true){
this.props.form.setFieldsValue({
org2:''
})
}
}
}).catch((error)=>{
console.log(error);
})
}
filterList =(e)=>{
const inputVal = e.trim()
let arr=[];
if(inputVal){
arr= this.state.schoolList.filter(function(item){
return item.name.indexOf(inputVal)>-1;
});
this.props.form.setFieldsValue({
org: inputVal
})
this.setState({
school: inputVal,
filterSchoolList: arr
})
} else {
this.setState({
school: '',
})
}
// else{
// let {school}=this.state;
// arr= this.state.schoolList.filter(function(item){
// return item.name.indexOf(school)>-1;
// });
// }
}
setVisible = (visible) => {
this.refs.modalWrapper.setVisible(visible)
}
@ -53,6 +271,7 @@ class RealNameCertificationModal extends Component{
let url = `/users/accounts/${current_user && current_user.login}/authentication_apply.json`
axios.post((url),{
name:basicInfo.name,
gender:parseInt(values.sex),
id_number:values.credentials
}).then((result)=>{
if(result){
@ -65,12 +284,13 @@ class RealNameCertificationModal extends Component{
})
}else{
// 职业认证
// console.log(values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2);
let url = `/users/accounts/${current_user && current_user.login}/professional_auth_apply.json`
axios.post((url),{
school_id:basicInfo && basicInfo.school_id,
department_id:basicInfo && basicInfo.department_id,
identity:basicInfo && basicInfo.identity,
extra:basicInfo && basicInfo.identity == "student" ? basicInfo.student_id:basicInfo.technical_title
school_id:this.state.school_id,
department_id:this.state.department_id,
identity:this.state.identity,
extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2
}).then((result)=>{
if(result){
this.props.showNotification("申请已提交,请等待审核!");
@ -119,13 +339,99 @@ class RealNameCertificationModal extends Component{
}));
}
}
// 切换职称
changeJob=(e)=>{
this.setState({
identity:e
})
let {basicInfo}=this.props;
if(basicInfo){
this.props.form.setFieldsValue({
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}
}
// 选择学校(获取对应学校的学院、部门)
changeList=(e)=>{
this.getDepartments(e.trim(),true);
}
showApplyForAddOrgModal = () => {
this.applyForAddOrgForm.setVisible(true)
}
showApplyForAddChildOrgModal = () => {
let{school,schoolList}=this.state;
let arr=schoolList.filter(function(item){
return item.name == school;
});
if(arr.length > 0){
this.applyForAddChildOrgForm.setVisible(true)
}else{
this.props.showNotification("请先选择正确的单位或者学校!");
}
}
addOrgSuccess = (name) => {
// const schoolList = this.state.schoolList.slice(0)
// schoolList.push({ id: schoolList.length + 2000, name: name})
// this.setState({ schoolList })
this.getSchoolList(this.props.basicInfo, name);
this.props.form.setFieldsValue({
org: name
})
}
addChildOrgSuccess = (deptName) => {
this._getDepartments(this.state.school_id, false, deptName);
}
// 隐藏或显示真实姓名
showOrHide=(flag)=>{
const name = this.props.form.getFieldsValue().name || this.props.basicInfo.name
this.setState({
showRealName:flag==true?false:true
})
if(flag==true){ // 隐藏真实姓名
this.hideRealName(name);
}else{ // 显示
this.props.form.setFieldsValue({
name: this.state.realName
})
}
}
render(){
const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2 } = this.state
const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2,
identity,
departmentsName ,
filterSchoolList ,
filterDepartments ,
school,
department_id,
departments,
school_id,
showRealName
} = this.state
const { moduleName } = this.props
const { getFieldDecorator } = this.props.form;
let {certification}=this.props;
// /api/users/accounts/${this.props.current_user.login}/auth_attachment.json
// 已职业认证的账户不能修改职业,学校/单位,院系/部门true为disable
const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
let{ basicInfo }=this.props
let common={
changeJob:this.changeJob,
filterList:this.filterList,
changeList:this.changeList,
showApplyForAddOrgModal:this.showApplyForAddOrgModal,
showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal
}
const uploadProps2 = {
name: 'image',
data:{type:certification == 1 ? "real_name" : "professional"},
@ -136,7 +442,19 @@ class RealNameCertificationModal extends Component{
className: 'idPic-uploader',
onChange: this.handleChange2,
};
// form合并了
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
return(
<div>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...propsWithoutForm} addOrgSuccess={this.addOrgSuccess}
></ApplyForAddOrgModal>
<ApplyForAddChildOrgModal ref="applyForAddChildOrgModal" schoolName={school} schoolId={school_id} departmentName={departmentsName}
{...propsWithoutForm} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form}
addChildOrgSuccess={this.addChildOrgSuccess}
></ApplyForAddChildOrgModal>
<ModalWrapper
ref="modalWrapper"
title={
@ -148,6 +466,7 @@ class RealNameCertificationModal extends Component{
onOk={this.onOk}
okText="保存"
className="applyForModal certificationModal courseNormalForm"
width="660px"
bottomRender={
certification && certification == 1?
<div className="bottomRender">
@ -202,9 +521,9 @@ class RealNameCertificationModal extends Component{
.certificationModal .ant-modal-body{
padding:20px;
}
.certificationModal .formItemInline .ant-form-item-control-wrapper {
width: 448px;
}
// .certificationModal .formItemInline .ant-form-item-control-wrapper {
// width: 448px;
// }
span.idPic-uploader {
margin-right:20px;
height:110px;
@ -255,16 +574,77 @@ class RealNameCertificationModal extends Component{
align-items: center;
display: -webkit-flex;
}
.formItemInline.ant-form-item {
display: -ms-flexbox;
display: flex;
}
.formItemInline {
display: flex;
margin-bottom: 10px;
position: relative;
}
.formItemInline .ant-form-explain{
position:absolute;
bottom:-20px;
left:0px;
width:100%;
}
.yslgraduainputedit{
width:295px;
}
`}</style>
<Form onSubmit={this.handleSubmit}>
{
certification && certification ==1 &&
{ certification && certification == 1 ?
<div>
<Form.Item
label="姓名"
className="formItemInline"
>
{ basicInfo.authentication == 'uncertified' ? <React.Fragment>{getFieldDecorator('name', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`,
validator: this.checkNameLength
}],
})(
<Input placeholder={`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`} className="yslgraduainputedit" disabled={!showRealName && this.state.forDisable == true } addonAfter={
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName)}></i>
}></Input>
)}
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</React.Fragment> :
<div className="df" style={{}}>
<Tooltip title="已完成实名认证,不能修改">
<span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
</Tooltip>
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName)}></i>
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</div>
}
</Form.Item>
<Form.Item
label="性别"
className="formItemInline resetSexStyle"
>
{getFieldDecorator('sex', {
rules: [{
required: true,
message: '请选择性别',
}],
})(
<RadioGroup>
<ConditionToolTip title="已完成实名认证,不能修改" condition={basicInfo.authentication != 'uncertified'} >
<Radio value="0" disabled={basicInfo.authentication != 'uncertified'}></Radio>
<Radio value="1" disabled={basicInfo.authentication != 'uncertified'}></Radio>
</ConditionToolTip>
</RadioGroup>
)}
</Form.Item>
<Form.Item
label="证件号:"
className="formItemInline"
@ -279,14 +659,29 @@ class RealNameCertificationModal extends Component{
<Input placeholder="请输入证件号" ></Input>
)}
</Form.Item>
}
<div style={{ marginLeft: '18px' }}>
<div>
<span style={{color: '#999999'}}>{ certification && certification == 1 ? "身份证(人像面)上传":"职业证照片上传" }</span>
<span style={{color: '#FF6800'}}>png/jpg/bmp格式不超过2MB</span>
</div>
<div className="df mt20" style={{ justifyContent: 'center' }} >
:
<AccountBasicEditItem
identity={identity}
getFieldDecorator = {getFieldDecorator}
professionalFlag = {professionalFlag}
basicInfo = {basicInfo}
{...this.props}
{...this.state}
{...common}
form={this.props.form}
filterSchoolList={filterSchoolList}
filterDepartments={filterDepartments}
departmentsName={departmentsName}
school={school}
department_id={department_id}
departments={departments}
></AccountBasicEditItem>
}
<div className="mt15" style={{ marginLeft: '18px' }}>
<div className="df">
<span style={{color: '#999999'}}>{ certification && certification == 1 ? "身份证上传:":"职业证上传:" }</span>
<div className="df ml10" style={{ justifyContent: 'center' }} >
<span className="idPic-uploader demoImg">
<img src={`${certification == 1 ? authImg : jobImg}`} alt="avatar" style={{ maxHeight: '110px'}}/>
</span>
@ -305,21 +700,25 @@ class RealNameCertificationModal extends Component{
}
</Dragger>
</div>
<div className="df mt10 color-grey-9" style={{ justifyContent: 'center' }} >
<span className="fl mr20 edu-txt-center" style={{width:"160px"}}>示例图片</span>
<span className="fl edu-txt-center mr20" style={{width:"160px"}}>
</div>
<div className="df mt10 color-grey-9">
<span className="fl edu-txt-center" style={{width:"200px",marginLeft:"65px"}}>
<p>示例图片</p>
<p className="font-12" style={{color: '#FF6800'}}>png/jpg/bmp格式不超过2MB</p>
</span>
<span className="fl edu-txt-center" style={{width:"160px"}}>
<ImageLayer2 parentSel={'#imageLayerBtn'} parentSel={'#imageLayerBtn'}
></ImageLayer2>
<a href="javascript:void(0)" id="imageLayerBtn" src={imageUrl || imageUrl2} className="color-orange" style={{borderBottom:"1px solid #ff6800"}}>查看大图</a>
</span>
</div>
</div>
</Form>
</ModalWrapper>
</div>
)
}
}

Loading…
Cancel
Save