Browse Source

uas手机版
待办下拉刷新

samhoo 5 years ago
parent
commit
343aaa35bb

+ 21 - 1
uas-office-web/uas-mobile/src/pages/private/taskTodo/TaskTodo.jsx

@@ -5,6 +5,7 @@
 
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
+import ReactDOM from 'react-dom'
 import './task-todo.less'
 import TaskTodoItem from '../../../components/private/tasktodo/TaskTodoItem'
 import { isObjEmpty } from '../../../utils/common/common.util'
@@ -21,12 +22,26 @@ class TaskTodo extends Component {
     this.state = {
       data: [],
       refreshing: false,
+      height: document.documentElement.clientHeight,
     }
   }
 
   componentDidMount () {
     document.title = '待办任务'
     this.getListData()
+    setTimeout(() => {
+      if (this.props.height) {
+        this.setState({
+          height: this.props.height,
+        })
+      } else {
+        const hei = this.state.height -
+          ReactDOM.findDOMNode(this.ptr).getBoundingClientRect().top
+        this.setState({
+          height: hei,
+        })
+      }
+    }, 0)
   }
 
   componentWillUnmount () {
@@ -34,7 +49,7 @@ class TaskTodo extends Component {
   }
 
   render () {
-    let { data } = this.state
+    let { data, height } = this.state
 
     return (
       <div className="task-todo-page">
@@ -45,6 +60,11 @@ class TaskTodo extends Component {
           refreshing={this.state.refreshing}
           onRefresh={this.refreshFunc}
           className='report-func-root'
+          ref={el => this.ptr = el}
+          style={{
+            height: height,
+            overflow: 'auto',
+          }}
         >
           <TaskTodoItem rowList={data}/>
         </PullToRefresh>

+ 4 - 0
uas-office-web/uas-mobile/src/pages/private/taskTodo/task-todo-work.less

@@ -5,6 +5,10 @@
   position: relative;
   overflow: hidden;
 
+  * {
+    touch-action: none;
+  }
+
   .task-des-panel {
     background: #fff;
     padding: 8px;