index.jsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import React, { Component } from 'react';
  2. import style from './index.less';
  3. import $ from 'jquery';
  4. class TipsMsg extends Component {
  5. constructor(props) {
  6. super(props);
  7. }
  8. componentWillReceiveProps(){
  9. //滚动条定位到提示信息模块
  10. const {patDom} = this.props;
  11. const ht = $(patDom.current).height();
  12. $(patDom.current).scrollTop(ht);
  13. }
  14. render() {
  15. const { tips, showTips, tipsDiscalimer, tipsImg, tmpFlg} = this.props;
  16. return <div className={style["tips"]}>
  17. <h1>
  18. <img src={tipsImg} />
  19. 提示信息
  20. </h1>
  21. <div className={style["content"]}>
  22. {tips && tips.details ? (
  23. <div>
  24. <div className={style["title"]}>
  25. {tips.name}
  26. <span
  27. className={style["tips-details"]}
  28. onClick={() => showTips()}
  29. // style={{display:tmpFlg?'none':'inline-block'}}
  30. >
  31. 详情
  32. </span>
  33. </div>
  34. {tips.details &&
  35. tips.details.map((item, index) => {
  36. return (
  37. <div>
  38. <div
  39. dangerouslySetInnerHTML={{
  40. __html: item.title
  41. }}
  42. />
  43. <div
  44. dangerouslySetInnerHTML={{
  45. __html: item.content
  46. }}
  47. />
  48. {item.isReason === 1 && (
  49. <div className={style["warn"]}>
  50. {tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '1')&&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '1').description}
  51. </div>
  52. )}
  53. </div>
  54. );
  55. })}
  56. </div>
  57. ) : (
  58. "无"
  59. )}
  60. </div>
  61. </div>
  62. }
  63. }
  64. export default TipsMsg;