index.jsx 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React, { Component } from 'react';
  2. import style from './index.less';
  3. import arrowIcon from '@images/arrowIcon.png';
  4. import pushEmpty from '@images/pushEmpty.png';
  5. import {pushPage2} from '@utils/config';
  6. import {getUrlArgObject} from '@utils/tools';
  7. import {dragBox} from '@utils/drag';
  8. import hideConfirm from '@images/hideConfirm.png';
  9. class PushData extends Component{
  10. constructor(props){
  11. super(props);
  12. this.state = {
  13. hashNum:0
  14. }
  15. this.showPushData = this.showPushData.bind(this)
  16. this.hidePushData = this.hidePushData.bind(this)
  17. }
  18. showPushData(){
  19. const {togglePushData} = this.props
  20. setTimeout(function(){
  21. dragBox('dragModalWrap','dragModalTitle','add')
  22. })
  23. togglePushData()
  24. }
  25. hidePushData(){
  26. const {togglePushData} = this.props
  27. dragBox('dragModalWrap','dragModalTitle','del')
  28. togglePushData()
  29. }
  30. handleScroll(e){
  31. e.preventDefault();
  32. }
  33. componentWillReceiveProps(next){
  34. }
  35. render(){
  36. const hideLg = getUrlArgObject("hideLg");
  37. const {mrId,isTcm,planCode,showPushData ,windowWidth,hospitalId} = this.props
  38. const pushBoxPos = windowWidth>1200?(windowWidth-1200)/2:0;
  39. const url =`${pushPage2}?mrId=${mrId.indexOf("reStart") > - 1?"":mrId}&isTcm=${isTcm}&planCode=${planCode}&hospitalId=${hospitalId}${mrId.indexOf("reStart") > - 1 ? '&reStart='+Math.random():""}`+(hideLg?`&hideLg=1`:``);
  40. return <div >
  41. {!showPushData&&<div className={style['slideButton']} style={{right:pushBoxPos+'px'}} onClick={this.showPushData}>
  42. {hideLg?'智能提醒':'朗通智能提醒'}
  43. <img class={style['arrowIcon']} src={arrowIcon} alt=""/>
  44. </div>}
  45. {showPushData&&<div id="dragModalWrap" className={style['pushWrapper']} style={{right:pushBoxPos+'px'}} onWheel={this.handleScroll.bind(this)}>
  46. {/* <div id="dragModalTitle" className={style['pushDataTitle']}>朗通智能提醒 <span className={style['pushDataHide']} onClick={this.hidePushData}>收起</span></div> */}
  47. <div className={style['pushDataTitle']}>{hideLg?'智能提醒':'朗通智能提醒'} <span className={style['pushDataHide']} onClick={this.hidePushData}> <img class={style['hideConfirm']} src={hideConfirm} alt=""/></span></div>
  48. {hospitalId&&<iframe id='embedPage' src={url} frameborder="0" width="400" height="557" onWheel={this.handleScroll.bind(this)}></iframe>}
  49. {!hospitalId&&<div className={style['pushEmpty']}>
  50. <div className={style['pushEmptyBox']}>
  51. <img className={style['pushEmptyImg']} src={pushEmpty} alt=""/>
  52. <p className={style['pushEmptyTxt']}>等待内容输入中…</p>
  53. </div>
  54. </div>}
  55. </div>}
  56. </div>
  57. }
  58. }
  59. export default PushData;