|
|
@@ -1,54 +1,55 @@
|
|
|
/**
|
|
|
-* Created by FANGlh on 2019/1/17 8:57.
|
|
|
-* Desc: 进出校通知详情
|
|
|
-*/
|
|
|
+ * Created by FANGlh on 2019/1/17 8:57.
|
|
|
+ * Desc: 进出校通知详情
|
|
|
+ */
|
|
|
|
|
|
-import React,{Component} from 'react';
|
|
|
+import React, {Component} from 'react';
|
|
|
import {connect} from 'react-redux';
|
|
|
import './AccessNoticeDetail.css';
|
|
|
-import {isObjEmpty,getIntValue, getStrValue} from '../../../utils/common';
|
|
|
-import {getWeixinInfo} from '../../../utils/api.request'
|
|
|
-import {fetchPost, fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
|
|
|
+import {isObjEmpty, getIntValue, getStrValue} from '../../../utils/common';
|
|
|
+import {fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
|
|
|
import {API, _baseURL} from '../../../configs/api.config';
|
|
|
|
|
|
|
|
|
-class AccessNoticeDetail extends Component{
|
|
|
- constructor(props){
|
|
|
+class AccessNoticeDetail extends Component {
|
|
|
+ constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
- studentName:'',
|
|
|
- studentType:'出校时间',
|
|
|
- studentPhoto:'http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark',
|
|
|
- studentHourMinues:'',
|
|
|
+ studentName: '',
|
|
|
+ studentType: '出校时间',
|
|
|
+ studentPhoto: 'http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark',
|
|
|
+ studentHourMinues: '',
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
componentWillMount() {
|
|
|
}
|
|
|
+
|
|
|
componentDidMount() {
|
|
|
let stuId = this.props.match.params.stuId
|
|
|
let role = this.props.match.params.role
|
|
|
let anId = this.props.match.params.anId
|
|
|
- console.log("stuId",stuId)
|
|
|
- if (!isObjEmpty(stuId)){
|
|
|
- this.getANDetail(stuId,anId)
|
|
|
+ console.log("stuId", stuId)
|
|
|
+ if (!isObjEmpty(stuId)) {
|
|
|
+ this.getANDetail(stuId, anId)
|
|
|
}
|
|
|
|
|
|
|
|
|
let curDay = new Date().getDay()
|
|
|
- if(curDay == 1){
|
|
|
+ if (curDay == 1) {
|
|
|
curDay = '星期一'
|
|
|
- }else if(curDay == 2){
|
|
|
+ } else if (curDay == 2) {
|
|
|
curDay = '星期二'
|
|
|
- }else if(curDay == 3){
|
|
|
+ } else if (curDay == 3) {
|
|
|
curDay = '星期三'
|
|
|
- }else if(curDay == 4){
|
|
|
+ } else if (curDay == 4) {
|
|
|
curDay = '星期四'
|
|
|
- }else if(curDay == 5){
|
|
|
+ } else if (curDay == 5) {
|
|
|
curDay = '星期五'
|
|
|
- }else if(curDay == 6){
|
|
|
+ } else if (curDay == 6) {
|
|
|
curDay = '星期六'
|
|
|
- }else if(curDay == 7){
|
|
|
+ } else if (curDay == 7) {
|
|
|
curDay = '星期日'
|
|
|
}
|
|
|
|
|
|
@@ -56,31 +57,33 @@ class AccessNoticeDetail extends Component{
|
|
|
let hout_min = new Date().getHours() + ':' + new Date().getMinutes()
|
|
|
|
|
|
this.setState({
|
|
|
- studentName:this.props.userInfo.user.student.stuName,
|
|
|
- studentType:'出校时间',
|
|
|
- studentPhoto:'http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark',
|
|
|
- studentTime:hout_min,
|
|
|
- studentDate:date,
|
|
|
+ studentName: this.props.userInfo.user.student.stuName,
|
|
|
+ studentType: '出校时间',
|
|
|
+ studentPhoto: 'http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark',
|
|
|
+ studentTime: hout_min,
|
|
|
+ studentDate: date,
|
|
|
})
|
|
|
}
|
|
|
- render(){
|
|
|
- const { studentName,studentType,studentPhoto,studentTime,studentDate} = this.state
|
|
|
- return(
|
|
|
- <div style={{textAlign:'center',}}>
|
|
|
+
|
|
|
+ render() {
|
|
|
+ const {studentName, studentType, studentPhoto, studentTime, studentDate} = this.state
|
|
|
+ return (
|
|
|
+ <div style={{textAlign: 'center',}}>
|
|
|
<div className="an_student_name">{studentName}</div>
|
|
|
- <img className="an_student_photo" src = {studentPhoto} alt = ""/>
|
|
|
+ <img className="an_student_photo" src={studentPhoto} alt=""/>
|
|
|
<div className="an_student_type">{studentType}</div>
|
|
|
<div className='an_student_foot_time'>
|
|
|
- <span style={{color:'#222222',fontSize:24,paddingRight:10,}}>{studentTime}</span>
|
|
|
- <span style={{color:'#666666',fontsize:12,}}>{studentDate}</span>
|
|
|
+ <span style={{color: '#222222', fontSize: 24, paddingRight: 10,}}>{studentTime}</span>
|
|
|
+ <span style={{color: '#666666', fontsize: 12,}}>{studentDate}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
- getANDetail =(stuId,anId)=>{
|
|
|
+
|
|
|
+ getANDetail = (stuId, anId) => {
|
|
|
fetchGet(API.leaveDetail, {
|
|
|
stuId: stuId,
|
|
|
- anId:anId
|
|
|
+ anId: anId
|
|
|
}).then((response) => {
|
|
|
if (response.success && !isObjEmpty(response.data)) {
|
|
|
|