|
|
@@ -23,6 +23,7 @@ import icon_home_change from "../../style/imgs/icon_home_change.png";
|
|
|
|
|
|
const operation = Modal.operation;
|
|
|
|
|
|
+
|
|
|
class HomePage extends Component {
|
|
|
|
|
|
constructor() {
|
|
|
@@ -121,13 +122,14 @@ class HomePage extends Component {
|
|
|
return (
|
|
|
<div className='home-page-root'>
|
|
|
<div className='home-top-layout-root'>
|
|
|
- {this.userInfoLayout()}
|
|
|
<div className='home-student-layout-root'>
|
|
|
{studentList}
|
|
|
</div>
|
|
|
- <div className='home-top-menu-root'>
|
|
|
- {this.getTopMenus()}
|
|
|
- </div>
|
|
|
+ {this.userInfoLayout()}
|
|
|
+ <div className="white_san_jiao"></div>
|
|
|
+ </div>
|
|
|
+ <div className='home-top-menu-root'>
|
|
|
+ {this.getTopMenus()}
|
|
|
</div>
|
|
|
{/*功能菜单*/}
|
|
|
{userInfo.userRole == 1 ? this.getParentMenu() : this.getTeacherMenu()}
|
|
|
@@ -265,25 +267,25 @@ class HomePage extends Component {
|
|
|
operation([
|
|
|
{
|
|
|
text: '家长', onPress: () => {
|
|
|
- if (this.props.userInfo.userRole === 2) {
|
|
|
- Toast.loading('身份切换中...', 0)
|
|
|
- setTimeout(() => {
|
|
|
- Toast.success('切换成功!', 1)
|
|
|
- switchCurrentUser(1)()
|
|
|
- }, 400)
|
|
|
- }
|
|
|
+ if (this.props.userInfo.userRole === 2) {
|
|
|
+ Toast.loading('身份切换中...', 0)
|
|
|
+ setTimeout(() => {
|
|
|
+ Toast.success('切换成功!', 1)
|
|
|
+ switchCurrentUser(1)()
|
|
|
+ }, 400)
|
|
|
}
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
text: '教师', onPress: () => {
|
|
|
- if (this.props.userInfo.userRole === 1) {
|
|
|
- Toast.loading('身份切换中...', 0)
|
|
|
- setTimeout(() => {
|
|
|
- Toast.success('切换成功!', 1)
|
|
|
- switchCurrentUser(2)()
|
|
|
- }, 400)
|
|
|
- }
|
|
|
+ if (this.props.userInfo.userRole === 1) {
|
|
|
+ Toast.loading('身份切换中...', 0)
|
|
|
+ setTimeout(() => {
|
|
|
+ Toast.success('切换成功!', 1)
|
|
|
+ switchCurrentUser(2)()
|
|
|
+ }, 400)
|
|
|
}
|
|
|
+ }
|
|
|
},
|
|
|
])
|
|
|
}
|
|
|
@@ -302,24 +304,31 @@ class HomePage extends Component {
|
|
|
userName = userInfo.teacher.teacherName
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return (
|
|
|
<div>
|
|
|
- <div className='home-top-school-text'>{schoolName}</div>
|
|
|
- <div className='home-top-msg-root'>
|
|
|
- {isObjEmpty(userInfo.userAvatar) ?
|
|
|
- <Avatar size={50} icon='user'/> :
|
|
|
- <img
|
|
|
- src={userInfo.userAvatar}
|
|
|
- width={50} height={50} className="img-circle"
|
|
|
- style={{border: '3px solid #ffffff'}}/>
|
|
|
- }
|
|
|
- <span
|
|
|
- className='home-top-msg-text'>尊敬的{userName + (userInfo.userRole === 1 ? '家长' : '老师')}</span>
|
|
|
- {(userInfo.teacher && userInfo.parent) ?
|
|
|
- <img style={{marginLeft: "5px"}} src={icon_home_change} width={16}
|
|
|
- height={16} onClick={this.onIdentitySwitch}/> : ''}
|
|
|
-
|
|
|
+ <div className='home-top-school-text'> {(userInfo.teacher && userInfo.parent) ?
|
|
|
+ <img style={{marginLeft: "5px"}} src={icon_home_change} width={16}
|
|
|
+ height={16} onClick={this.onIdentitySwitch}/> : ''}
|
|
|
</div>
|
|
|
+ {
|
|
|
+ userInfo.userRole === 1 ?
|
|
|
+ <div className='home-student-layout-root' style={{display:'flex',flexDirection:'column'}}>
|
|
|
+ <div className='home-top-msg-text'>{userName +' | ' + schoolName}</div>
|
|
|
+ </div>
|
|
|
+ :
|
|
|
+ <div className='home-top-msg-root' style={{paddingBottom:10}}>
|
|
|
+ {isObjEmpty(userInfo.userAvatar) ?
|
|
|
+ <Avatar size={42} icon='user'/> :
|
|
|
+ <img
|
|
|
+ src={userInfo.userAvatar}
|
|
|
+ width={42} height={42} className="img-circle"
|
|
|
+ style={{border: '3px solid #ffffff'}}/>
|
|
|
+ }
|
|
|
+ <span
|
|
|
+ className='home-top-msg-text'>{userName +' | ' + schoolName}</span>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
@@ -401,6 +410,26 @@ 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 (this.state.studentIndex !== stuIndex) {
|
|
|
Toast.loading('学生切换中...', 0)
|
|
|
setTimeout(() => {
|
|
|
@@ -478,7 +507,7 @@ class MenuGroup extends Component {
|
|
|
render() {
|
|
|
return (
|
|
|
<div className='home-group-item-layout'>
|
|
|
- <img className='home-group-item-icon' src={this.props.groupIcon}/>
|
|
|
+ {/*<img className='home-group-item-icon' src={this.props.groupIcon}/>*/}
|
|
|
<span className='home-group-item-text'>{this.props.groupText}</span>
|
|
|
</div>
|
|
|
)
|
|
|
@@ -513,15 +542,18 @@ class StuItem extends Component {
|
|
|
return (
|
|
|
<div onClick={this.onStuSwitch} className='home-top-stu-layout'>
|
|
|
{this.props.stuObj.stuPhoto ?
|
|
|
- <img className={this.props.isSelect ? 'border-radius-50-blue' : 'border-radius-50'}
|
|
|
+ <img className={this.props.isSelect ? 'student_select_img' : 'student_noselect_img'}
|
|
|
src={_baseURL + this.props.stuObj.stuPhoto}
|
|
|
- width={25} height={25}/> :
|
|
|
- <Avatar className={this.props.isSelect ? 'border-radius-50-blue' : 'border-radius-50'}
|
|
|
- size={23} icon='user'/>}
|
|
|
-
|
|
|
- <span
|
|
|
- className={this.props.isSelect ? "margin_left_5 color_blue text_bold"
|
|
|
- : 'margin_left_5'}>{this.props.stuObj.stuName}</span>
|
|
|
+ /> :
|
|
|
+ this.props.isSelect ?
|
|
|
+ <Avatar className={this.props.isSelect ? 'border-radius-50-blue' : 'border-radius-50'}
|
|
|
+ size={42} icon='user'/> :
|
|
|
+ <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>*/}
|
|
|
</div>
|
|
|
);
|
|
|
}
|