Commit a8a84d48 by 姜雷

Merge branch 'develop' into test

parents b19cfc55 e83cda8f
...@@ -5,7 +5,30 @@ import PublicCarApply from './PublicCarApply'; ...@@ -5,7 +5,30 @@ import PublicCarApply from './PublicCarApply';
import styles from './style.css'; import styles from './style.css';
class PublicCar extends Component { class PublicCar extends Component {
constructor(props) {
super(props);
this.state = {
showFooter: true,
};
}
componentDidMount() {
let screenHeight = document.body.offsetHeight;
window.onresize = () => {
let nowHeight = document.body.offsetHeight;
if (nowHeight < screenHeight) {
this.setState({
showFooter: false,
});
} else {
this.setState({
showFooter: true,
});
}
};
}
render() { render() {
const { showFooter } = this.state;
return ( return (
<div className="Content-Wrap"> <div className="Content-Wrap">
<div className="RepairContent"> <div className="RepairContent">
...@@ -18,23 +41,25 @@ class PublicCar extends Component { ...@@ -18,23 +41,25 @@ class PublicCar extends Component {
<Route render={() => <Redirect to="/publicCar/PublicCarApply" />} /> <Route render={() => <Redirect to="/publicCar/PublicCarApply" />} />
</Switch> </Switch>
</div> </div>
<div className={styles.footer}> {showFooter && (
<NavLink <div className={styles.footer}>
className={styles['footer-item']} <NavLink
to="/publicCar/PublicCarApply" className={styles['footer-item']}
replace to="/publicCar/PublicCarApply"
> replace
约车服务 >
</NavLink> 约车服务
<span className={styles.line} /> </NavLink>
<NavLink <span className={styles.line} />
className={styles['footer-item']} <NavLink
to="/publicCar/PublicCarList" className={styles['footer-item']}
replace to="/publicCar/PublicCarList"
> replace
约车记录 >
</NavLink> 约车记录
</div> </NavLink>
</div>
)}
</div> </div>
); );
} }
......
...@@ -4,19 +4,31 @@ import styles from './style.css'; ...@@ -4,19 +4,31 @@ import styles from './style.css';
import ReprtRepair from './ReprtRepair'; import ReprtRepair from './ReprtRepair';
import RepairList from './RepairList'; import RepairList from './RepairList';
class index extends Component { class index extends Component {
state = { constructor(props) {
tab: 'ReprtRepair', super(props);
}; this.state = {
toggleRouteHandle = name => { showFooter: true,
if (name === this.state.tab) return; };
console.log(name); }
const { history } = this.props;
this.setState({ componentDidMount() {
tab: name, let screenHeight = document.body.offsetHeight;
}); window.onresize = () => {
history.replace('/repair/' + name); let nowHeight = document.body.offsetHeight;
}; if (nowHeight < screenHeight) {
this.setState({
showFooter: false,
});
} else {
this.setState({
showFooter: true,
});
}
};
}
render() { render() {
const { showFooter } = this.state;
return ( return (
<div className="Content-Wrap"> <div className="Content-Wrap">
<div className="RepairContent"> <div className="RepairContent">
...@@ -26,23 +38,25 @@ class index extends Component { ...@@ -26,23 +38,25 @@ class index extends Component {
<Route render={() => <Redirect to="/repair/ReprtRepair" />} /> <Route render={() => <Redirect to="/repair/ReprtRepair" />} />
</Switch> </Switch>
</div> </div>
<div className={styles.footer}> {showFooter && (
<NavLink <div className={styles.footer}>
className={styles['footer-item']} <NavLink
to="/repair/ReprtRepair" className={styles['footer-item']}
replace to="/repair/ReprtRepair"
> replace
报修服务 >
</NavLink> 报修服务
<span className={styles.line} /> </NavLink>
<NavLink <span className={styles.line} />
className={styles['footer-item']} <NavLink
to="/repair/RepairList" className={styles['footer-item']}
replace to="/repair/RepairList"
> replace
报修记录 >
</NavLink> 报修记录
</div> </NavLink>
</div>
)}
</div> </div>
); );
} }
......
...@@ -4,6 +4,14 @@ ...@@ -4,6 +4,14 @@
overflow-y: auto; overflow-y: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
.footerTopLine {
position: absolute;
top: -5px;
width: 100%;
height: 6px;
background: linear-gradient(0deg, #626466, transparent);
opacity: 0.3;
}
.footer { .footer {
width: 100%; width: 100%;
height: 80px; height: 80px;
...@@ -12,6 +20,7 @@ ...@@ -12,6 +20,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 30px; font-size: 30px;
border-top: 1px solid #dee0de;
} }
.line { .line {
width: 2px; width: 2px;
...@@ -22,6 +31,7 @@ ...@@ -22,6 +31,7 @@
flex: 1; flex: 1;
color: #999; color: #999;
text-align: center; text-align: center;
background-color: #fff;
} }
:global(.active) { :global(.active) {
background-color: #3695c0; background-color: #3695c0;
......
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