Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7416579

Browse files
committed
Final version
1 parent b909948 commit 7416579

File tree

24 files changed

+16554
-25
lines changed

24 files changed

+16554
-25
lines changed

src/components/TopTab/TopTab.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export default class TopTab extends Component {
1212

1313
return (
1414
<div className={conClass}>
15-
<Link to='/' >
15+
<Link to='/group/reward' activeClassName={classes.active}>
1616
<div className={classes.tab}>我的奖励</div>
1717
</Link>
18-
<Link to='/' >
18+
<Link to='/group/part' activeClassName={classes.active}>
1919
<div className={classes.tab}>我的分成</div>
2020
</Link>
21-
<Link to='/' >
22-
<div className={[classes.tab, classes.active].join(' ')}>我要提现</div>
21+
<Link to='/group/withdraw' activeClassName={classes.active}>
22+
<div className={classes.tab}>我要提现</div>
2323
</Link>
2424
</div>
2525
)

src/components/TopTab/TopTab.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
border-bottom: 1px solid #dbdbdb;
33
margin-bottom: 24px;
44
}
5+
56
.tab {
67
color: #333333;
78
font-size: 14px;
@@ -11,8 +12,10 @@
1112
position: relative;
1213
top: 1px;
1314
z-index: 1;
15+
}
1416

15-
&.active {
17+
.active {
18+
& .tab {
1619
border-bottom: 2px solid #00b9fb;
1720
}
1821
}

src/layouts/CoreLayout/CoreLayout.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import headImg from './head.png'
66

77
import { Menu, Breadcrumb, Icon } from 'antd'
88
import 'antd/dist/antd.css'
9+
//import '../../styles/antd.css'
910

1011
import { IndexLink, Link } from 'react-router'
1112

@@ -40,31 +41,31 @@ class CoreLayout extends Component {
4041
<IndexLink to='/' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
4142
<i className="anticon anticon-home"/><span class="nav-text">首页</span>
4243
</IndexLink>
43-
<Link to='/list' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
44+
<Link to='/group' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
4445
<i className="anticon anticon-tag"/><span class="nav-text">团购</span>
4546
</Link>
46-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
47+
<Link to='/define' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
4748
<i className="iconfont icon-logo"/><span class="nav-text">自定义书单</span>
4849
</Link>
49-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
50+
<Link to='/books' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
5051
<i className="iconfont icon-book"/><span class="nav-text">童书</span>
5152
</Link>
52-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
53+
<Link to='/order' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
5354
<i className="anticon anticon-file-text"/><span class="nav-text">订单</span>
5455
</Link>
55-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
56+
<Link to='/reward' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
5657
<i className="anticon anticon-pay-circle"/><span class="nav-text">奖励</span>
5758
</Link>
58-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
59+
<Link to='/team' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
5960
<i className="anticon anticon-team"/><span class="nav-text">推广伙伴</span>
6061
</Link>
61-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
62+
<Link to='/family' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
6263
<i className="iconfont icon-family"/><span class="nav-text">阅读家庭</span>
6364
</Link>
64-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
65+
<Link to='/statistic' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
6566
<i className="anticon anticon-line-chart"/><span class="nav-text">统计</span>
6667
</Link>
67-
<Link to='/a' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
68+
<Link to='/setting' className="ant-menu-item" activeClassName='ant-menu-item-selected'>
6869
<i className="anticon anticon-setting"/><span class="nav-text">设置</span>
6970
</Link>
7071
</div>
@@ -109,7 +110,7 @@ class CoreLayout extends Component {
109110
</div>
110111
<div className="ant-layout-footer">
111112
Shenzhen Caldecott Cultural Communications Co.,Ltd.<br />
112-
© 2009-2016 深圳市凯迪克文化传播有限公司旗下 孩宝小镇 版权所有 <a href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备12087424号-2</a>
113+
© 2009-2016 深圳市凯迪克文化传播有限公司旗下 孩宝小镇 版权所有 <a className={classes.gov} href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备12087424号-2</a>
113114
</div>
114115
</div>
115116
</div>

src/layouts/CoreLayout/CoreLayout.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
width: 48px;
1919
height: 48px;
2020
border-radius: 6px;
21-
margin: 16px 14px 16px 28px;
21+
margin: 16px 14px 16px 24px;
2222
transition: all 0.3s ease;
2323
display: inline-block;
2424
}
@@ -283,3 +283,7 @@
283283
float: left;
284284
cursor: pointer;
285285
}
286+
287+
.gov {
288+
color: #a0a0a0;
289+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React, {Component} from 'react'
2+
import classes from './Part.scss'
3+
import TopTab from 'components/TopTab'
4+
5+
export default class PartView extends Component {
6+
7+
render () {
8+
9+
return (
10+
<div>
11+
<TopTab></TopTab>
12+
<h1>我的分成</h1>
13+
</div>
14+
)
15+
}
16+
}

src/routes/Group/Part/components/Part.scss

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { connect } from 'react-redux'
2+
import { fetchZen, clearZen } from '../modules/part'
3+
4+
import PartView from '../components/Part'
5+
6+
const mapActionCreators = {
7+
fetchZen,
8+
clearZen
9+
}
10+
11+
const mapStateToProps = (state) => ({
12+
reward: state.reward
13+
})
14+
15+
export default connect(mapStateToProps, mapActionCreators)(PartView)

src/routes/Group/Part/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { injectReducer } from '../../../store/reducers'
2+
3+
export default (store) => ({
4+
path: 'part',
5+
getComponent (nextState, cb) {
6+
require.ensure([], (require) => {
7+
const Part = require('./containers/partContainer').default
8+
const reducer = require('./modules/part').default
9+
injectReducer(store, { key: 'part', reducer })
10+
cb(null, Part)
11+
})
12+
}
13+
})

src/routes/Group/Part/modules/part.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// ------------------------------------
2+
// Constants
3+
// ------------------------------------
4+
const RECEIVE_ZEN = 'RECEIVE_ZEN'
5+
const REQUEST_ZEN = 'REQUEST_ZEN'
6+
const CLEAR_ZEN = 'CLEAR_ZEN'
7+
8+
// ------------------------------------
9+
// Actions
10+
// ------------------------------------
11+
12+
function requestZen () {
13+
return {
14+
type: REQUEST_ZEN
15+
}
16+
}
17+
18+
let avaliableId = 0
19+
export const receiveZen = (value) => ({
20+
type: RECEIVE_ZEN,
21+
payload: {
22+
text: value,
23+
id: avaliableId++
24+
}
25+
})
26+
27+
export const clearZen = () => ({
28+
type: CLEAR_ZEN
29+
})
30+
31+
export function fetchZen () {
32+
return (dispatch, getState) => {
33+
if (getState().zen.fetching) return
34+
35+
dispatch(requestZen())
36+
return fetch('https://api.github.com/zen')
37+
.then(data => data.text())
38+
.then(text => dispatch(receiveZen(text)))
39+
}
40+
}
41+
42+
export const actions = {
43+
requestZen,
44+
receiveZen,
45+
clearZen,
46+
fetchZen
47+
}
48+
49+
// ------------------------------------
50+
// Action Handlers
51+
// ------------------------------------
52+
const ACTION_HANDLERS = {
53+
[REQUEST_ZEN]: (state) => {
54+
return ({...state, fetching: true})
55+
},
56+
[RECEIVE_ZEN]: (state, action) => {
57+
return ({...state, fetching: false, text: state.text.concat(action.payload)})
58+
},
59+
[CLEAR_ZEN]: (state) => {
60+
return ({...state, text: []})
61+
}
62+
}
63+
64+
// ------------------------------------
65+
// Reducer
66+
// ------------------------------------
67+
const initialState = {
68+
fetching: false,
69+
text: []
70+
}
71+
export default function (state = initialState, action) {
72+
const handler = ACTION_HANDLERS[action.type]
73+
74+
return handler ? handler(state, action) : state
75+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React, {Component} from 'react'
2+
import classes from './Reward.scss'
3+
import TopTab from 'components/TopTab'
4+
5+
export default class ListView extends Component {
6+
7+
render () {
8+
9+
return (
10+
<div>
11+
<TopTab></TopTab>
12+
<h1>我的奖励</h1>
13+
</div>
14+
)
15+
}
16+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
.loader{
2+
text-align: center;
3+
padding-top:20px;
4+
5+
div{
6+
display: inline-block;
7+
}
8+
}
9+
10+
.con {
11+
background: #fff;
12+
border-radius: 5px;
13+
box-shadow: 0 0 5px rgba(0,0,0,.2);
14+
padding: 16px 20px;
15+
}
16+
17+
.type {
18+
float: left;
19+
}
20+
21+
.typeitem {
22+
float: left;
23+
color: #333333;
24+
padding: 8px 15px;
25+
border: 1px solid #e7e7ec;
26+
border-right: none;
27+
font-size: 12px;
28+
line-height: 1;
29+
cursor: pointer;
30+
31+
&:first-child {
32+
border-top-left-radius: 3px;
33+
border-bottom-left-radius: 3px;
34+
}
35+
&:last-child {
36+
border-top-right-radius: 3px;
37+
border-bottom-right-radius: 3px;
38+
border: 1px solid #e7e7ec;
39+
}
40+
}
41+
42+
.typeactive{
43+
border: 1px solid #00b9fb;
44+
color: #00b9fb;
45+
46+
&:first-child {
47+
border: 1px solid #00b9fb;
48+
}
49+
&:last-child {
50+
border: 1px solid #00b9fb;
51+
}
52+
}
53+
54+
.date {
55+
width: 246px;
56+
position: absolute;
57+
left: 50%;
58+
margin-left: -123px;
59+
}
60+
61+
.btn {
62+
float: right;
63+
}
64+
65+
.money_con {
66+
margin-bottom: 14px;
67+
}
68+
69+
.money_left {
70+
position: absolute;
71+
}
72+
73+
.money_item {
74+
background: #ff596c;
75+
color: #fff;
76+
font-size: 14px;
77+
border-radius: 3px;
78+
width: 310px;
79+
height: 106px;
80+
text-align: center;
81+
float: left;
82+
83+
& span {
84+
display: block;
85+
padding-top: 25px;
86+
line-height: 1;
87+
}
88+
89+
& em {
90+
font-size: 26px;
91+
line-height: 1;
92+
margin-top: 14px;
93+
font-style: normal;
94+
display: block;
95+
}
96+
}
97+
98+
.money_right {
99+
margin-left: 334px;
100+
background: #fff;
101+
box-shadow: 0 0 3px rgba(0,0,0,.1);
102+
103+
& .money_item{
104+
background: #fff;
105+
color: #333333;
106+
position: relative;
107+
width: 33.3%;
108+
109+
&:after {
110+
content: '';
111+
border-right: 1px solid #e7e7eb;
112+
height: 48px;
113+
position: absolute;
114+
right: 0;
115+
top: 30px;
116+
}
117+
118+
&:last-child {
119+
&:after {
120+
border-right: none;
121+
}
122+
}
123+
}
124+
}
125+
126+
.table_top {
127+
margin-bottom: 16px;
128+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { connect } from 'react-redux'
2+
import { fetchZen, clearZen } from '../modules/reward'
3+
4+
import RewardView from '../components/Reward'
5+
6+
const mapActionCreators = {
7+
fetchZen,
8+
clearZen
9+
}
10+
11+
const mapStateToProps = (state) => ({
12+
reward: state.reward
13+
})
14+
15+
export default connect(mapStateToProps, mapActionCreators)(RewardView)

0 commit comments

Comments
 (0)