import React, { Component } from "react";
import PunchClocks from './punchClocks';
import UserFloatingLayer from "../../components/common/userFloatingLayer";
import { AtModal, } from "taro-ui"
import Taro from "@tarojs/taro";
import { updateLocation } from '../../utils/servers/servers';

class PunchClock extends Component {
  constructor(props) {
    super(props);
    this.state = {
      data: {},
      isOpened: false,
      isHome: false,
    }
    this.onClose = this.onClose.bind(this);

  }

  componentDidShow() {

  }

  onClose() {
    this.setState({
      data: {},
      isOpened: false,
      isHome: false,
    })
  }

  getId(id, uid) {
    this.setState({ id, uid })
  }
  // 判断是否是首页打卡切换位置
  getHome() {
    this.setState({ isHome: true })
  }


  componentDidMount() {
    Taro.eventCenter.trigger('GoPuncsshIn', { data: 'unread' })
  }


  render() {
    return (
      <>
        <UserFloatingLayer />
        <PunchClocks
          getId={this.getId.bind(this)}
          getHome={this.getHome.bind(this)}
        />
      </>
    )
  }
}

export default PunchClock;
