|
|
@@ -23,7 +23,6 @@ import icon_home_change from "../../style/imgs/icon_home_change.png";
|
|
|
|
|
|
const operation = Modal.operation;
|
|
|
|
|
|
-
|
|
|
class HomePage extends Component {
|
|
|
|
|
|
constructor() {
|
|
|
@@ -31,6 +30,7 @@ class HomePage extends Component {
|
|
|
|
|
|
this.state = {
|
|
|
studentIndex: 0,
|
|
|
+ selectStuName:'',//被切换之后的选中的孩子
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -251,7 +251,9 @@ class HomePage extends Component {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- this.setState({studentIndex})
|
|
|
+ this.setState({studentIndex:studentIndex,
|
|
|
+ selectStuName:this.props.userInfo.parent.students[studentIndex].stuName
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
this.mySwiper.init()
|
|
|
@@ -299,7 +301,8 @@ class HomePage extends Component {
|
|
|
if (userInfo.userRole === 1) {
|
|
|
if (userInfo.parent) {
|
|
|
schoolName = userInfo.parent.schoolName
|
|
|
- userName = userInfo.parent.parentsName
|
|
|
+ // userName = userInfo.parent.parentsName
|
|
|
+ userName = this.state.selectStuName
|
|
|
}
|
|
|
} else if (userInfo.userRole === 2) {
|
|
|
if (userInfo.teacher) {
|
|
|
@@ -443,7 +446,8 @@ class HomePage extends Component {
|
|
|
setTimeout(() => {
|
|
|
Toast.success('切换成功!', 1)
|
|
|
this.setState({
|
|
|
- studentIndex: stuIndex
|
|
|
+ studentIndex: stuIndex,
|
|
|
+ selectStuName:this.props.userInfo.parent.students[stuIndex].stuName
|
|
|
})
|
|
|
switchUser({
|
|
|
parent: {
|