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

debug

parent 6ee4303b
This diff is collapsed.
public/img/footer-work-s.png

2.45 KB | W: | H:

public/img/footer-work-s.png

2.66 KB | W: | H:

public/img/footer-work-s.png
public/img/footer-work-s.png
public/img/footer-work-s.png
public/img/footer-work-s.png
  • 2-up
  • Swipe
  • Onion skin
public/img/footer-work.png

1.59 KB | W: | H:

public/img/footer-work.png

1.7 KB | W: | H:

public/img/footer-work.png
public/img/footer-work.png
public/img/footer-work.png
public/img/footer-work.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
import React from 'react';
import React, {Component} from 'react';
import Footer from './Footer'
import {withRouter} from 'react-router-dom'
import './index.less'
const CommonLayout = (props) => {
return (
<div>
<div className="common-layout-content">
<div>
{props.children}
</div>
class CommonLayout extends Component {
constructor(){
super();
this.resize = this.resize.bind(this)
}
resize = (defaultH) => {
const scrollHeight = document.body.scrollHeight;
const footer = document.getElementById("footer");
const content = document.getElementById("common-content")
if (footer) {
if (defaultH > scrollHeight) {
footer.classList.remove('footer');
footer.classList.add('footer-static')
}else {
footer.classList.add('footer')
footer.classList.remove('footer-static');
}
}
if (content) {
if (defaultH > scrollHeight) {
content.classList.remove('common-layout-content');
content.classList.add('common-layout-content-static');
}else {
content.classList.add('common-layout-content');
content.classList.remove('common-layout-content-static');
}
}
// 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>
</div>
<Footer {...this.props}/>
</div>
<Footer {...props}/>
</div>
);
};
);
}
}
export default withRouter(CommonLayout) ;
......@@ -25,13 +25,12 @@ class Footer extends Component {
];
return (
<div className="footer">
<div id="footer" className="footer">
<TabBar
unselectedTintColor="#949494"
tintColor="#2E67EA"
barTintColor="white"
>
{tabItem.map(item => (
<TabBar.Item
key={item.key}
......
......@@ -4,6 +4,11 @@
overflow: auto;
padding-bottom: 10px
}
.common-layout-content-static{
position: fixed;
top: 0;left: 0;right: 0;bottom: 10px;
overflow: auto;
}
.footer-tab-icon{
width: 18px;
......@@ -15,7 +20,10 @@
background: rgba(35,35,35, 0.5);
}
.footer{
width: 100%;
position: fixed;
width: 100%;
bottom: 0;
}
.footer-static{
display: none;
}
......@@ -3,16 +3,18 @@ import {WhiteSpace, WingBlank, ActivityIndicator} from 'antd-mobile'
import TodoCard from '../../components/TodoCard'
import TopSearch from '../../components/TopSearch'
class Index extends Component {
state={
loading: false
}
constructor(){
super();
this.state={
loading: false
};
};
checkLog = () => {
this.props.history.push(`/blank/example/1`)
}
render() {
const {loading} = this.state
const {loading} = this.state;
return (
<WingBlank>
<ActivityIndicator
......
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