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 &&

常用药物治疗

{treatment.map((item, index) => { return(
{index + 1 + '. ' }{item.drugsName}:  {item.medicitionsList.map((it, ii) => { return ((it.isShow == 1 || it.selected) && {ii === 0 ? '' : ', '} {this.setDrugInfo(it);showDrugInfo();}} onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}> {it.medicitionName} {/* {it.showInfo && it.showInfo==='1'&& {this.setDrugInfo(it);showDrugInfo();}}/>} */} {it.forbidden === '1' ? 慎用: it.forbidden === '2' ? 禁用 : ''}, 使用率{it.rate} ) })}
{
this.setOtherRecommend(item, index)} >更多同类药
}
) })}
) } } export default DrugTreat;