index.jsx 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import React,{ Component } from 'react';
  2. import style from './index.less';
  3. import GeneralTreat from './GeneralTreat/index.jsx';
  4. import DrugTreat from './DrugTreat/index.jsx';
  5. import TreatDesc from '@components/TreatDesc'
  6. import DrugInfo from '@components/TreatDesc/DrugInfo';
  7. import Notify from '@commonComp/Notify'
  8. import close from './img/close.png';
  9. import generalIcon from './img/general.png';
  10. import surgicalIcon from './img/surgical.png';
  11. import $ from "jquery";
  12. class Treat extends Component {
  13. constructor(props){
  14. super(props);
  15. this.hideTreat = this.hideTreat.bind(this);
  16. this.handlePrescription = this.handlePrescription.bind(this);
  17. this.handleDetermine = this.handleDetermine.bind(this);
  18. }
  19. hideTreat() {
  20. const { hideTreat,clearTreat } = this.props;
  21. clearTreat && clearTreat();
  22. hideTreat && hideTreat();
  23. }
  24. handlePrescription() {
  25. Notify.info('该功能即将上线,敬请期待。', 2000)
  26. }
  27. handleDetermine() {
  28. const { title, treatment } = this.props
  29. const { addScheme } = this.props
  30. addScheme && addScheme(title, treatment);
  31. this.hideTreat()
  32. }
  33. showDrugInfo() {
  34. const { showDrugInfo } = this.props;
  35. showDrugInfo && showDrugInfo();
  36. }
  37. render(){
  38. const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title} = this.props;
  39. return(
  40. <div className={style['treat-wrapper']}>
  41. <div className={style['treat-mask']}>
  42. </div>
  43. <div id='treatWrapper' className={style['treat-box']}>
  44. <div className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
  45. <div className={style['treat-inner-box']}>
  46. <GeneralTreat icon={generalIcon} title='一般治疗' generalTreat={generalTreat}></GeneralTreat>
  47. <DrugTreat treatment={ treatment }
  48. selectDrug={selectDrug}
  49. setOtherRecommend={ setOtherRecommend }
  50. showDrugInfo = {showDrugInfo}
  51. setDrugInfo={ setDrugInfo }>
  52. </DrugTreat>
  53. <GeneralTreat icon={surgicalIcon} title='手术治疗' titleStyle={{background:'#FAEAEA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}} titleBg='#FAEAEA' generalTreat={surgeryTreat}></GeneralTreat>
  54. </div>
  55. <div className={style['bottom']}>
  56. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  57. </div>
  58. {treatDesc && <TreatDesc
  59. treatment={treatment}
  60. treatDesc={treatDesc}
  61. selectDrug={selectDrug}
  62. setDrugInfo={ setDrugInfo }
  63. showDrugInfo = {showDrugInfo}
  64. showDrug = {showDrug}
  65. >
  66. </TreatDesc>}
  67. </div>
  68. {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  69. </div>
  70. )
  71. }
  72. }
  73. export default Treat;