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