Browse Source

计算公式打开滚动到显示1710

zhouna 6 years ago
parent
commit
70a50007fa
2 changed files with 13 additions and 2 deletions
  1. 10 1
      src/components/ChronicInfo/index.jsx
  2. 3 1
      src/components/PushItems/index.jsx

+ 10 - 1
src/components/ChronicInfo/index.jsx

@@ -50,7 +50,6 @@ class ChronicInfo extends React.Component{
     };
     this.$result = React.createRef();
     this.$content = React.createRef();
-    this.$content = React.createRef();
     this.showInfo = this.showInfo.bind(this);
     this.closeInfo = this.closeInfo.bind(this);
     this.showOption = this.showOption.bind(this);
@@ -100,6 +99,11 @@ class ChronicInfo extends React.Component{
     this.setState({
       optionId:id,
       formulaId:null //关闭计算公式
+    });
+    const {patDom} = this.props;
+    const ht = $(patDom.current).height();
+    setTimeout(function(){
+      $(patDom.current).scrollTop(ht+200);
     })
   }
   closeOption(){
@@ -189,6 +193,11 @@ class ChronicInfo extends React.Component{
     this.setState({
       formulaId:id,
       optionId:null  //关闭可能结果
+    });
+    const {patDom} = this.props;
+    const ht = $(patDom.current).height();
+    setTimeout(function(){
+      $(patDom.current).scrollTop(ht+200);
     })
   }
   closeFormula(it){

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

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