import React, { Component } from 'react'; import style from './index.less'; import info from './../img/info.png'; import drugIcon from './../img/drug.png'; import more from '@common/images/addItem1.png'; import $ from "jquery"; class DrugTreat extends Component { constructor(props) { super(props); this.handleSelect = this.handleSelect.bind(this); this.setOtherRecommend = this.setOtherRecommend.bind(this); this.setDrugInfo = this.setDrugInfo.bind(this); this.showTreatDesc = this.showTreatDesc.bind(this); } handleSelect(index,ii) { const { selectDrug } = this.props; selectDrug && selectDrug(index,ii); } setOtherRecommend(item, index) { this.showTreatDesc(); const { setOtherRecommend } = this.props; setOtherRecommend && setOtherRecommend(item, index); } setDrugInfo(item) { const { setDrugInfo } = this.props; setDrugInfo && setDrugInfo(item); } showTreatDesc() { $('#treatDescBox').css({'display': 'block'}); $('#treatWrapper').animate({'margin-left': '-470px'}, 300); $('#treatDescBox').animate({'width': '260px'}, 500); } render(){ const { treatment,showDrugInfo } = this.props return( treatment && treatment.length > 0 &&