|
|
@@ -9,7 +9,7 @@ import '../../style/css/app-gloal.css'
|
|
|
import {List, Input, Button} from 'antd';
|
|
|
import {fetchPost, fetchGet} from '../../utils/fetchRequest';
|
|
|
import {API, _baseURL} from '../../configs/api.config';
|
|
|
-import {getIntValue, getStrValue, isObjEmpty} from '../../utils/common';
|
|
|
+import {getIntValue, getSearchParams, getStrValue, isObjEmpty} from '../../utils/common';
|
|
|
import ImagesViewer from "../../components/imagesVIewer/ImagesViewer";
|
|
|
import {Toast} from 'antd-mobile'
|
|
|
import {Avatar} from 'antd'
|
|
|
@@ -48,6 +48,17 @@ class AssignmentDetailPage extends React.Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
+ this.searchParams = getSearchParams(this.props.location.search)
|
|
|
+ this.stuId = this.props.userInfo.user.student.stuId
|
|
|
+ this.parentId = this.props.userInfo.user.userFunId
|
|
|
+ if (this.searchParams) {
|
|
|
+ if (this.searchParams.stuId) {
|
|
|
+ this.stuId = this.searchParams.stuId
|
|
|
+ }
|
|
|
+ if (this.searchParams.parentId) {
|
|
|
+ this.parentId = this.searchParams.parentId
|
|
|
+ }
|
|
|
+ }
|
|
|
Toast.show('', 0)
|
|
|
this.getHomeworkDetail()
|
|
|
}
|
|
|
@@ -65,7 +76,7 @@ class AssignmentDetailPage extends React.Component {
|
|
|
getHomeworkDetail = () => {
|
|
|
fetchPost(API.HOMEWORK_DETAIL, {
|
|
|
taskId: this.state.id,
|
|
|
- stuId: this.props.userInfo.user.student.stuId
|
|
|
+ stuId: this.stuId
|
|
|
}).then((response) => {
|
|
|
Toast.hide()
|
|
|
if (response && response.data) {
|
|
|
@@ -142,8 +153,8 @@ class AssignmentDetailPage extends React.Component {
|
|
|
taskId: this.state.id,
|
|
|
replyTitle: '这是作业的回复',
|
|
|
replyContext: this.state.messageContent,
|
|
|
- parentId: this.props.userInfo.user.userFunId,
|
|
|
- stuId: this.props.userInfo.user.student.stuId
|
|
|
+ parentId: this.parentId,
|
|
|
+ stuId: this.stuId
|
|
|
}
|
|
|
fetchPost(API.HOMEWORK_REPLY, {
|
|
|
taskRepayString: JSON.stringify(params)
|
|
|
@@ -194,7 +205,7 @@ class AssignmentDetailPage extends React.Component {
|
|
|
<div className="homework-detail-top-name">{this.state.teachName}老师</div>
|
|
|
<div className='homework-detail-top-time'>
|
|
|
<span>截止时间:</span>
|
|
|
- <span >{this.state.endTime}</span>
|
|
|
+ <span>{this.state.endTime}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -213,9 +224,9 @@ class AssignmentDetailPage extends React.Component {
|
|
|
|
|
|
</div>
|
|
|
<div className="margin_top_bottom_10 homework-detail-leave-caption">
|
|
|
- <img src={leave_img} style={{height:18,width:21,marginRight:10}}/>
|
|
|
+ <img src={leave_img} style={{height: 18, width: 21, marginRight: 10}}/>
|
|
|
{this.state.data.length != 0 ? (
|
|
|
- <span>
|
|
|
+ <span>
|
|
|
({this.state.data.length}条)
|
|
|
</span>) : (<div></div>)}</div>
|
|
|
<div id="page_horizontal_line"></div>
|
|
|
@@ -227,10 +238,10 @@ class AssignmentDetailPage extends React.Component {
|
|
|
locale={{emptyText: '暂无留言'}}
|
|
|
dataSource={this.state.data}
|
|
|
renderItem={item => (
|
|
|
- <div style={{display: 'flex',paddingTop:5,paddingBottom:5}}>
|
|
|
- <div className="homework-detail-leave-name">{item.name}:</div>
|
|
|
- <div className='homework-detail-leave-content'>{item.content}</div>
|
|
|
- </div>
|
|
|
+ <div style={{display: 'flex', paddingTop: 5, paddingBottom: 5}}>
|
|
|
+ <div className="homework-detail-leave-name">{item.name}:</div>
|
|
|
+ <div className='homework-detail-leave-content'>{item.content}</div>
|
|
|
+ </div>
|
|
|
)}/>
|
|
|
</div>
|
|
|
{this.state.role === "teacher" ? "" :
|