Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

zhaoy 6 years ago
parent
commit
0a939604e4

+ 31 - 24
frontend/wechat-web/src/modules/home/HomePage.jsx

@@ -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>
         );
     }

+ 1 - 1
frontend/wechat-web/src/style/css/home-page.css

@@ -131,7 +131,7 @@
     font-family: PingFangSC-Regular;
     font-size: 12px;
     letter-spacing: 1.6px;
-    padding: 5px 10px;
+    padding: 5px 10px 0px 10px;
     float: left;
     text-align: center;
 }