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",
				}}>
          <Detailss
						qiandaoxiangq={(b)=>this.props.qiandaoxiangq(b)}
						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;
