Browse Source

成绩通知pageindex问题

RaoMeng 6 năm trước cách đây
mục cha
commit
f381d26cc6

+ 1 - 1
frontend/wechat-web/src/modules/hiPages/scorenotification/ScoreNotification.js

@@ -46,8 +46,8 @@ class ScoreNotification extends Component {
         this.setState({
             stuId: stuId
         }, function () {
+            pageIndex = 0
             this.getScoreData()
-            console.log("stuId", stuId)
         })
     }
 

+ 18 - 6
frontend/wechat-web/src/modules/vote/VoteDetailPage.js

@@ -11,7 +11,7 @@ import {API, _baseURL} from "../../configs/api.config";
 import {Toast} from 'antd-mobile'
 import ImageGrid from "../../components/image/ImageGrid";
 import {connect} from 'react-redux'
-import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
+import {getIntValue, getSearchParams, getStrValue, isObjEmpty} from "../../utils/common";
 import {saveListState} from "../../redux/actions/listState";
 
 let role   //parent ,teacher
@@ -34,7 +34,7 @@ class VoteDetailPage extends React.Component {
                 endTime: '2018-11-15 08:00',
                 selectState: 0,//0 单选 1 多选
                 votes: [],
-                voteStatus:''
+                voteStatus: ''
             }
         };
     }
@@ -43,6 +43,8 @@ class VoteDetailPage extends React.Component {
     componentWillMount() {
         document.title = "投票";
         role = this.props.match.params.role
+
+        this.searchParams = getSearchParams(this.props.location.search)
     }
 
     componentDidMount() {
@@ -59,14 +61,24 @@ class VoteDetailPage extends React.Component {
         // console.log("voteId",this.state.id)
         if (role === 'teacher') {
             url_detail = API.voteDetailTeacher
+
+            let id = this.props.userInfo.user.userFunId
+            if (this.searchParams && this.searchParams.teacherId) {
+                id = this.searchParams.teacherId
+            }
             params = {
-                teacherId: this.props.userInfo.user.userFunId,
+                teacherId: id,
                 voteId: this.state.id
             }
         } else if (role === 'parent') {
             url_detail = API.voteDetailParent
+
+            let id = this.props.userInfo.user.student.stuId
+            if (this.searchParams && this.searchParams.stuId) {
+                id = this.searchParams.stuId
+            }
             params = {
-                stuId: this.props.userInfo.user.student.stuId,
+                stuId: id,
                 voteId: this.state.id
             }
         }
@@ -122,9 +134,9 @@ class VoteDetailPage extends React.Component {
                 voteBean.voteStatusCode = getIntValue(item, 'voteStatus')
                 if (voteBean.voteStatusCode === 1) {
                     voteBean.voteStatus = '进行中'
-                }else if(voteBean.voteStatusCode === 4){
+                } else if (voteBean.voteStatusCode === 4) {
                     voteBean.voteStatus = '已截止'
-                }else {
+                } else {
                     voteBean.voteStatus = '已投票'
                 }
                 voteBean.creatDate = getStrValue(item, 'creatDate')