index.jsx 2.2 KB

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