|
|
@@ -122,9 +122,12 @@ class HomePage extends Component {
|
|
|
return (
|
|
|
<div className='home-page-root'>
|
|
|
<div className='home-top-layout-root'>
|
|
|
- <div className='home-student-layout-root'>
|
|
|
- {studentList}
|
|
|
- </div>
|
|
|
+ {
|
|
|
+ this.props.userInfo.userRole == 1 ?
|
|
|
+ <div className='home-student-layout-root'>
|
|
|
+ {studentList}
|
|
|
+ </div> : ''
|
|
|
+ }
|
|
|
{this.userInfoLayout()}
|
|
|
<div className="white_san_jiao"></div>
|
|
|
</div>
|
|
|
@@ -412,23 +415,28 @@ class HomePage extends Component {
|
|
|
onStuSwitch = (stuIndex) => {
|
|
|
console.log("onStuSwitch",stuIndex)
|
|
|
|
|
|
- /* if(stuIndex == 0){
|
|
|
- return
|
|
|
- }else {
|
|
|
- const studentList = this.props.userInfo.parent.students
|
|
|
- var centerStu = studentList[stuIndex]
|
|
|
- switchUser({
|
|
|
- parent:{
|
|
|
- ...this.props.userInfo.parent,
|
|
|
- students:studentList,
|
|
|
- student:centerStu
|
|
|
- },
|
|
|
- user:{
|
|
|
- ...this.props.userInfo.parent,
|
|
|
- students:studentList,
|
|
|
- student:centerStu
|
|
|
- }
|
|
|
- })()
|
|
|
+ /* if (stuIndex != 0) {
|
|
|
+ Toast.loading('学生切换中...', 0)
|
|
|
+ setTimeout(() => {
|
|
|
+ Toast.success('切换成功!', 1)
|
|
|
+ const studentList = this.props.userInfo.parent.students
|
|
|
+ const centerStu = studentList[stuIndex]
|
|
|
+ studentList[stuIndex] = studentList[0]
|
|
|
+ studentList[0] = centerStu
|
|
|
+
|
|
|
+ switchUser({
|
|
|
+ parent: {
|
|
|
+ ...this.props.userInfo.parent,
|
|
|
+ students:studentList,
|
|
|
+ student: centerStu
|
|
|
+ },
|
|
|
+ user: {
|
|
|
+ ...this.props.userInfo.parent,
|
|
|
+ students:studentList,
|
|
|
+ student: centerStu
|
|
|
+ }
|
|
|
+ })()
|
|
|
+ }, 400)
|
|
|
}*/
|
|
|
if (this.state.studentIndex !== stuIndex) {
|
|
|
Toast.loading('学生切换中...', 0)
|
|
|
@@ -449,7 +457,6 @@ class HomePage extends Component {
|
|
|
})()
|
|
|
}, 400)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
getTeacherMenu = () => {
|
|
|
@@ -551,9 +558,9 @@ class StuItem extends Component {
|
|
|
<Avatar className={this.props.isSelect ? 'border-radius-50-blue' : 'border-radius-50'}
|
|
|
size={30} icon='user'/>
|
|
|
}
|
|
|
- {/*<span*/}
|
|
|
- {/*className={this.props.isSelect ? "margin_left_5 color_blue text_bold"*/}
|
|
|
- {/*: 'margin_left_5'}>{this.props.stuObj.stuName}</span>*/}
|
|
|
+ {/* <span
|
|
|
+ className={this.props.isSelect ? "margin_left_5 color_blue text_bold"
|
|
|
+ : 'margin_left_5'}>{this.props.stuObj.stuName+','+this.props.isSelect}</span>*/}
|
|
|
</div>
|
|
|
);
|
|
|
}
|