/** * 鍒囨崲鍦板浘鎸夐挳 */ import React, { Component } from 'react'; import { Row, Col } from 'antd'; export default class SwitchMap extends Component { constructor(props) { super(props); this.state = { layerSatatus: props.layerSatatus }; } componentDidMount() {} componentWillReceiveProps(nextPorps) { this.setState({ layerSatatus: nextPorps.layerSatatus }); } render() { return ( <div className="radio_container-switch"> <div className="switch-button" className={ this.state.layerSatatus==='attendance' ? 'switch-button active' : 'switch-button' } onClick={() => { this.props.switchMap('attendance'); }} > <img src={require('../../../assets/images/prevention/map.png')}></img> <div className="text">椹诲嫟鐐�</div> </div> <div className="switch-button" className={ this.state.layerSatatus==='person' ? 'switch-button active' : 'switch-button' } onClick={() => { this.props.switchMap('person'); }} > <img src={require('../../../assets/images/prevention/person.jpg')}></img> <div className="text">浜哄憳</div> </div> <div className={ this.state.layerSatatus==='mass' ? 'switch-button active' : 'switch-button' } onClick={() => { this.props.switchMap('mass'); }} > <img src={require('../../../assets/images/prevention/mass.png')}></img> <div className="text">澶ф暟鎹棯鐐瑰浘灞�</div> </div> </div> ); } }