Commit 05c741e2 by 姜雷

带出用户数据

parent e40e259b
......@@ -4,6 +4,7 @@ import { applyPublicCar, fetchCarCategory } from '../../api/index';
import styles from './style.css';
import { formatDate } from '../../utils/index';
import arrIcon from '../../components/Input/Select/images/select_icon@2x.png';
import UserInfoContext from '../../context/userinfo-context'
const CustomChildren = ({ extra, onClick, children }) => (
<div onClick={onClick} className={styles.selectWrap}>
......@@ -17,9 +18,9 @@ class PublicCarApply extends Component {
constructor(props) {
super(props);
this.state = {
department: '',
department: props.userinfo.department,
createDate: formatDate(new Date(), 'yyyy-MM-dd'),
name: '',
name: props.userinfo.name,
categoryId: '',
userCount: '',
beginDate: '',
......@@ -207,4 +208,8 @@ class PublicCarApply extends Component {
}
}
export default PublicCarApply;
export default props => (
<UserInfoContext.Consumer>
{({ userinfo }) => <PublicCarApply userinfo={userinfo} {...props} />}
</UserInfoContext.Consumer>
);
......@@ -14,6 +14,7 @@ import { fetchRepairArea, fetchRepairTerm } from '../../api/index';
import { reportRepair } from '../../api/repairAdd';
import Perview from '../../components/Perview/Perview';
import store from '../../store/index';
import UserInfoContext from '../../context/userinfo-context';
class ReprtRepair extends Component {
constructor(props) {
......@@ -22,8 +23,8 @@ class ReprtRepair extends Component {
areaList: [],
termList: [],
applyForm: {
name: '',
repairCellphone: '',
name: props.userinfo.name,
repairCellphone: props.userinfo.cellphone,
applyIdentity: '学生',
area: '',
areaId: '',
......@@ -356,4 +357,8 @@ class ReprtRepair extends Component {
}
}
export default ReprtRepair;
export default props => (
<UserInfoContext.Consumer>
{({ userinfo }) => <ReprtRepair userinfo={userinfo} {...props} />}
</UserInfoContext.Consumer>
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment