import React, { Component } from 'react'; import style from './index.less'; import $ from "jquery"; import close from './img/close.png'; import info from './img/info.png'; import info1 from './img/info1.png'; class TreatDesc extends Component { constructor(props){ super(props); this.state = { currentIndex: -1 } this.hideTreatDesc = this.hideTreatDesc.bind(this); this.handleSelect= this.handleSelect.bind(this); this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this) } handleMouseEnterImg(index) { this.setState({ currentIndex: index, }) } handleMouseLeaveImg() { this.setState({ currentIndex: -1, }) } handleSelect(index,ii) { const { selectDrug } = this.props; selectDrug && selectDrug(index,ii); } hideTreatDesc() { $('#treatDescBox').css({'display': 'none'}); $('#treatDescBox').animate({'display': 'none'}, 500); $('#treatWrapper').animate({'margin-left': '-340px'}, 500); } render(){ const { treatment, treatDesc, setDrugInfo, showDrugInfo} = this.props const { title, basic, otherDrugIndex, drugDesc} = treatDesc const { currentIndex } = this.state return (treatment && treatment.length >0 &&