import React,{ Component } from "react";
import '../css/signincdi.css';
import Detailss from '../component/Detailss';
import Signedinlist from './Signedinlist'
import axios from 'axios';

//在线学习
class Signindetails extends Component{
	constructor(props){
		super(props);

		this.state={
			headdata:null
		}

	}

	componentDidMount() {
		this.mygetdatas()
	}
	mygetdatas=()=>{
		const  switattendance_id=this.props.switattendance_id;
		let urls = `/weapps/attendances/${switattendance_id}.json`;
		axios.get(urls).then((response) => {
			//.log(response);
			if(response){
				if(response.data){
					this.setState({
						headdata:response.data
					})

				}
			}
		})
	}



	render(){
		let {headdata}= this.state;
		return(
			<React.Fragment>
				<div className="ws100s" style={{
					position: "relative",
				}}>
					<div className="ws100s mb20">
						<p className="sortinxdirection" >
							<i className="iconfont icon-zuojiantou  posiivsiconmyss mr5 colorbluesigin xiaoshou" onClick={()=>this.props.qiandaoxiangq(false)}></i>
						  <p className="fh mr20 colorbluesigin xiaoshou" onClick={()=>this.props.qiandaoxiangq(false)}>正在签到</p>
						</p>

					</div>
          <Detailss
						defaultActiveKey={this.props.defaultActiveKey}
						headdata={headdata}
						switattendance_id={this.props.switattendance_id}
						{...this.props}
						{...this.state}></Detailss>


				{/*	列表+筛选 */}
				 <div>
					 <Signedinlist
						 mygetdatas={()=>this.mygetdatas()}
						 defaultActiveKey={this.props.defaultActiveKey}
						 switattendance_id={this.props.switattendance_id}
						 headdata={headdata}
						 {...this.props}
						 {...this.state}
					 />
				 </div>
				</div>
			</React.Fragment>
		)
	}
}
export default Signindetails;