Browse Source

右侧展开收起交互优化,滚动到底部

zhouna 6 years atrás
parent
commit
b6437be348
2 changed files with 10 additions and 2 deletions
  1. 9 2
      src/components/PushItems/TipsMsg/index.jsx
  2. 1 0
      src/components/PushItems/index.jsx

+ 9 - 2
src/components/PushItems/TipsMsg/index.jsx

@@ -1,13 +1,20 @@
 import React, { Component } from 'react';
 import style from './index.less';
+import $ from 'jquery';
 
 class TipsMsg extends Component {
     constructor(props) {
-        super(props)
+        super(props);
+    }
+    componentWillReceiveProps(){
+        //滚动条定位到提示信息模块
+        const {patDom} = this.props;
+        const ht = $(patDom.current).height();
+        $(patDom.current).scrollTop(ht);
     }
 
     render() {
-        const { tips, showTips, tipsDiscalimer, tipsImg, tmpFlg} = this.props
+        const { tips, showTips, tipsDiscalimer, tipsImg, tmpFlg} = this.props;
         return <div className={style["tips"]}>
         <h1>
           <img src={tipsImg} />

+ 1 - 0
src/components/PushItems/index.jsx

@@ -253,6 +253,7 @@ class PushItems extends Component {
             {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
             {<ChronicInfo></ChronicInfo>}
             <TipsMsg
+              patDom={this.$cont}
              tmpFlg = {tmpFlg}
              tipsImg = {tipsImg}
               tips = {tips}