Commit c36fc4a1 authored by 熊成伟's avatar 熊成伟

debug

parent 3da7408a
This diff is collapsed.
......@@ -12,9 +12,9 @@ const Index = (props) => {
className="todo-tag-png"
src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591252471425&di=85236ae603ca74553adaca6e8c161a39&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fb912bf96dc19b3b23530ae2259b60eb6cf70083f6680b-H9l0ri_fw658"
/>
收文管理
{props.TYPE}
</div>
<p>《2020年上级党委文件7号》</p>
<p>{props.TITLE}</p>
</div>
<span>
<img
......@@ -25,8 +25,8 @@ const Index = (props) => {
</span>
</div>
<div className="todo-content">
<p>当前状态:排版套头</p>
<p style={{marginTop: 15}}>发送人员:杜莹莹</p>
<p>当前状态:{props.STATUS}</p>
<p style={{marginTop: 15}}>发送人员:{props.FROMUSER_ALIASED}</p>
</div>
<div className="todo-footer">
<div>
......
import React, {Component} from 'react';
import React, {useEffect, useState} from 'react';
import Footer from './Footer'
import {withRouter} from 'react-router-dom'
import './index.less'
class CommonLayout extends Component {
constructor(){
super();
this.resize = this.resize.bind(this)
}
resize = (defaultH) => {
const CommonLayout = (props) => {
const resize = (defaultH) => {
const scrollHeight = document.body.scrollHeight;
const footer = document.getElementById("footer");
const content = document.getElementById("common-content")
......@@ -34,30 +30,24 @@ class CommonLayout extends Component {
}
// alert(`defaultH: ${defaultH} clientHeight: ${scrollHeight}`);
}
componentWillMount() {
const defaultH = document.body.scrollHeight;
window.addEventListener('resize', () => this.resize(defaultH))
}
componentWillUnmount() {
window.addEventListener('resize', this.resize)
}
render() {
return (
<div>
<div id="common-content" className="common-layout-content">
<div>
{this.props.children}
</div>
};
useEffect(() => {
const defaultH = document.body.scrollHeight;
window.addEventListener('resize', () => resize(defaultH));
return () => window.removeEventListener('resize', resize);
}, [])
return (
<div>
<div id="common-content" className="common-layout-content">
<div>
{props.children}
</div>
<Footer {...this.props}/>
</div>
);
}
}
</div>
<Footer {...props}/>
</div>
);
};
export default withRouter(CommonLayout) ;
import React, {useState} from 'react';
import React, {useState, useEffect} from 'react';
import {WhiteSpace, WingBlank, ActivityIndicator} from 'antd-mobile'
import TodoCard from '../../components/LogCard'
import TopSearch from '../../components/TopSearch'
const Backlog = (props) => {
const [current, setCurrent] = useState()
const [loading, setLoading] = useState(false)
const [loading, setLoading] = useState(false);
const [data, setData] = useState([{},{},{},{},{},{}]);
const checkLog = () => {
props.history.push(`/blank/info/example/1`)
}
};
//下拉加载
const handleScroll = () => {
const event = document.getElementById("common-content")
const top = event.scrollTop;
const scrollHeight = event.scrollHeight;
const clientHeight = event.clientHeight;
console.log(top, scrollHeight, clientHeight);
if (top + clientHeight === scrollHeight) {
setData([...data, {}, {}, {}, {}, {}, {}])
// setCurrent(current + 1)
}
};
useEffect(() => {
window.addEventListener('scroll', handleScroll, true);
return () => window.removeEventListener('scroll', handleScroll, true);
}, [])
return (
<WingBlank>
<ActivityIndicator
......@@ -20,7 +41,7 @@ const Backlog = (props) => {
<WhiteSpace/>
<TopSearch onSearch={val => console.log(val)}/>
{
[{},{},{},{},{},{}].map((item, index) => (
data.map((item, index) => (
<div key={index}>
<WhiteSpace/>
<TodoCard data={item} onClick={checkLog}/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment