Skip to content

Commit 2d3e0b6

Browse files
committed
现在基本上OK了
1 parent 8496b1e commit 2d3e0b6

File tree

14 files changed

+52
-41
lines changed

14 files changed

+52
-41
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/containers/Counter/Counter.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class Counter extends Component {
2121
render() {
2222
const { increment, decrement, reset } = this.props;
2323
return (
24-
<div>
24+
<div className={comStyles.navbar}>
2525
<div className={comStyles.btns}>
2626
<button onClick={() => Utility.toPage('userinfo')}>go to userinfo</button>
2727
<button onClick={() => Utility.$goBack()}>go back</button>
@@ -49,22 +49,3 @@ export default class Counter extends Component {
4949
);
5050
}
5151
}
52-
53-
// const mapStateToProps = (state) => {
54-
// return { counter: state.counter };
55-
// };
56-
// const mapDispatchToProps = (dispatch) => {
57-
// return {
58-
// increment: () => {
59-
// dispatch(increment);
60-
// },
61-
// decrement: () => {
62-
// dispatch(decrement);
63-
// },
64-
// reset: () => {
65-
// dispatch(reset);
66-
// },
67-
// };
68-
// };
69-
70-
// export default connect(mapStateToProps, mapDispatchToProps)(Counter);

src/containers/Default/Default.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
2-
// import PropTypes from 'prop-types';
3-
import { DefHref } from 'components';
2+
import { DefHref } from 'components';
3+
const comStyles = require('styles/Common.scss');
44

55
const styles = require('./scss/Default.scss');
66

@@ -15,7 +15,7 @@ export default class Default extends Component {
1515
}
1616
render() {
1717
return (
18-
<div className={styles.defaultCss}>
18+
<div className={comStyles.navbar + ' ' + styles.defaultCss}>
1919
<DefHref />
2020
</div>
2121
);

src/containers/Home/Home.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Utility, Navbar } from 'components';
3+
import { Utility } from 'components';
44

55
const styles = require('./scss/Home.scss');
66

@@ -27,14 +27,13 @@ export default class Home extends Component {
2727
const UrlTitle = Utility.constItem.UrlTitle;
2828
const __IsGoBackKey = Utility.constItem.KeyGoBack;
2929
this.context.router.history.listen((location, action) => {
30-
console.log(action === 'POP');
3130
Utility.setContent(__IsGoBackKey, action === 'POP');
3231
console.log('location is', location, 'action is', action);
33-
console.log('-----------home end---------------');
3432
const { pathname } = location;
3533
if (UrlTitle && UrlTitle[pathname]) {
3634
self.state.UrlTitle = UrlTitle[pathname];
37-
self.__UpdateRender();
35+
Utility.setContent('__URL_TITLE_INFO_', UrlTitle[pathname]);
36+
// self.__UpdateRender();
3837
}
3938
});
4039
}
@@ -59,13 +58,17 @@ export default class Home extends Component {
5958
Utility.toPage('userinfo');
6059
}
6160
render() {
62-
const { UrlTitle } = this.state;
63-
const { Title } = UrlTitle || {};
61+
// const { UrlTitle } = this.state;
62+
// const { Title } = UrlTitle || {};
63+
// const __Flag = 0;
6464

6565
return (
6666
<div className={styles.homeCss}>
67-
<Navbar Title={Title} />
67+
{}
6868
</div>
6969
);
7070
}
7171
}
72+
// {
73+
// __Flag === 2 && <Navbar Title={Title} />
74+
// }

src/containers/UserInfo/UserInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default class UserInfo extends Component {
3232
const styles = require('./ui.scss');
3333
const { userInfo, isLoading, errorMsg } = this.props.userInfo;
3434
return (
35-
<div className="userInfoCss">
35+
<div className={comStyles.navbar}>
3636
<div className={comStyles.btns}>
3737
<button onClick={() => Utility.toPage('page1')}>go to page1</button>
3838
<button onClick={() => Utility.$goBack()}>go back</button>

src/containers/page1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class Page1 extends Component {
1212

1313
render() {
1414
return (
15-
<div className={styles.page1Css}>
15+
<div className={comStyles.navbar + ' ' + styles.page1Css}>
1616
<div className={comStyles.btns}>
1717
<button onClick={() => Utility.toPage('page2')}>go to page2</button>
1818
<button onClick={() => Utility.$goBack()}>go back</button>

src/containers/page2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class Page2 extends Component {
1010

1111
render() {
1212
return (
13-
<div>
13+
<div className={comStyles.navbar}>
1414
<div className={comStyles.btns}>
1515
<button onClick={() => Utility.toPage('page3')}>go to page3</button>
1616
<button onClick={() => Utility.$goBack()}>go back</button>

src/containers/page3.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ export default class Page3 extends Component {
77
super(props);
88

99
this.state = {};
10+
console.log('----page3---', new Date().getTime());
1011
}
1112

1213
render() {
14+
console.log('----page3--111-', new Date().getTime());
1315
return (
14-
<div>
16+
<div className={comStyles.navbar}>
1517
<div className={comStyles.btns}>
1618
<button onClick={() => Utility.toPage('page4')}>go to page4</button>
1719
<button onClick={() => Utility.$goBack()}>go back</button>

src/containers/page4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class Page4 extends Component {
1010

1111
render() {
1212
return (
13-
<div>
13+
<div className={comStyles.navbar}>
1414
<div className={comStyles.btns}>
1515
<button onClick={() => Utility.toPage('counter')}>go to counter</button>
1616
<button onClick={() => Utility.$goBack()}>go back</button>

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Provider } from 'react-redux';
55
import BuildStore from './redux/store';
66
import ApiClient from './helpers/ApiClient';
77
import createHistory from 'history/createBrowserHistory';
8-
const history = createHistory({ basename: '/react' });
8+
const history = createHistory();
99
const ApiClientStore = BuildStore(new ApiClient(), history);
1010
import getRouter from './router/router';
1111
import { Router } from 'react-router';

0 commit comments

Comments
 (0)