Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Commit 9a021f8

Browse files
committed
normal deving
1 parent 59d22e7 commit 9a021f8

File tree

19 files changed

+386
-76
lines changed

19 files changed

+386
-76
lines changed

assets/GitHub_1188783_easyicon.net.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.

assets/ali_pay.jpg

29.4 KB
Loading

assets/chess.svg

Lines changed: 0 additions & 16 deletions
This file was deleted.

assets/wechat_pay.jpg

30.9 KB
Loading

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
HOST: 'http://ruarua.live',
2+
HOST: 'http://localhost',
33
}

src/components/Category/Category.css

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,12 @@
2828
z-index: 2;
2929
transition: none;
3030

31-
& .zoom {
32-
position: absolute !important;
33-
top: 0;
34-
right: 30px;
35-
& svg {
36-
color:#646464 !important;
37-
}
38-
}
39-
40-
& .setting {
31+
& .topSec {
4132
position: absolute !important;
4233
top: 0;
4334
right: 0;
44-
& svg {
35+
36+
& svg {
4537
color:#646464 !important;
4638
}
4739
}

src/components/Category/Category.jsx

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { connect } from 'react-redux';
3+
import { findDOMNode } from 'react-dom';
34
import classnames from 'classnames';
45
import styles from './Category.css';
56
import CategoryItem from 'components/CategoryItem';
@@ -40,6 +41,7 @@ class getCategory extends React.Component {
4041
super(props)
4142
this.toggleWidth = this.toggleWidth.bind(this)
4243
this.filterHander = this.filterHander.bind(this)
44+
//this.handleDocumentClick = this.handleDocumentClick.bind(this)
4345
}
4446

4547
filterHander(clas) {
@@ -51,7 +53,9 @@ class getCategory extends React.Component {
5153
}
5254

5355
componentWillUpdate(props, newProps) {
54-
if(props == newProps) return false;
56+
if(props.items.length == 0 && !props.layouts.open) {
57+
props.layoutsOpen(true)
58+
}
5559
}
5660

5761
componentDidUpdate() {
@@ -60,8 +64,8 @@ class getCategory extends React.Component {
6064

6165
render() {
6266
const typeName = preTypeTitle(this.props);
63-
const isOpen = this.props.open ? '' : 'tvHide';
64-
const isWidth = this.props.width ? 'tvWidth' : '';
67+
const isOpen = this.props.layouts.open ? '' : 'tvHide';
68+
const isWidth = this.props.layouts.width ? 'tvWidth' : '';
6569
const loading = this.props.data.loading;
6670
const isError = this.props.data.error;
6771
const items = this.props.data.data;
@@ -80,20 +84,28 @@ class getCategory extends React.Component {
8084

8185

8286
return (
83-
<div id="categoryContainer" className={classnames(styles.tv, styles[isOpen], styles[isWidth])}>
84-
<IconButton
85-
className={styles.setting}
86-
onClick={this.toggleWidth}
87-
>
88-
{ this.props.width ? <IconMini fill="#646464" /> : <IconZoom fill="#646464" />}
89-
</IconButton>
90-
{/*<IconButton
91-
className={styles.setting}
92-
tooltip="关闭"
93-
onClick={() => this.props.layoutsOpen(false) }
94-
>
95-
<CloseIco />
96-
</IconButton>*/}
87+
<div className={classnames(styles.tv, styles[isOpen], styles[isWidth])}>
88+
<div className={styles.topSec}>
89+
<IconButton
90+
onClick={this.toggleWidth}
91+
>
92+
{ this.props.width ? <IconMini fill="#646464" /> : <IconZoom fill="#646464" />}
93+
</IconButton>
94+
{
95+
this.props.items.length > 0
96+
?<IconButton
97+
tooltip="关闭"
98+
onClick={() => {
99+
if(this.props.items.length > 0) {
100+
this.props.layoutsOpen(false)
101+
}
102+
}}
103+
>
104+
<CloseIco />
105+
</IconButton>
106+
: ''
107+
}
108+
</div>
97109

98110
<div className={styles.categoryTitle}>
99111
<h2>{typeName}</h2>
@@ -124,9 +136,9 @@ class getCategory extends React.Component {
124136

125137
const mapStateToProps = (state, ownProps) => ({
126138
data: state.categorys,
127-
width: state.layouts.width,
128-
open: state.layouts.open,
139+
layouts: state.layouts,
129140
filter: state.categorys.filter,
141+
items: state.screenItems,
130142
})
131143

132144
const mapDispatchToProps = (dispatch, ownProps) => ({

src/components/Footer/Bug.jsx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import React from 'react';
2+
import Dialog from 'material-ui/Dialog';
3+
import FlatButton from 'material-ui/FlatButton';
4+
import IconButton from 'material-ui/IconButton';
5+
import styles from './Footer.css';
6+
7+
import IconBug from 'material-ui/svg-icons/action/bug-report';
8+
/**
9+
* Dialog with action buttons. The actions are passed in as an array of React objects,
10+
* in this example [FlatButtons](/#/components/flat-button).
11+
*
12+
* You can also close this dialog by clicking outside the dialog, or with the 'Esc' key.
13+
*/
14+
export default class Cheese extends React.Component {
15+
constructor(props) {
16+
super(props)
17+
this.handleOpen = this.handleOpen.bind(this)
18+
this.handleClose = this.handleClose.bind(this)
19+
20+
this.state = {
21+
open: false,
22+
};
23+
}
24+
25+
handleOpen() {
26+
this.setState({open: true});
27+
};
28+
29+
handleClose() {
30+
this.setState({open: false});
31+
};
32+
33+
render() {
34+
const actions = [
35+
<FlatButton
36+
label="Cancel"
37+
primary={true}
38+
onTouchTap={this.handleClose}
39+
/>,
40+
<FlatButton
41+
label="Submit"
42+
primary={true}
43+
keyboardFocused={true}
44+
onTouchTap={this.handleClose}
45+
/>,
46+
];
47+
48+
return (
49+
<div className={styles.btn}>
50+
<IconButton
51+
tooltip="Bug反馈"
52+
tooltipPosition="top-right"
53+
onClick={() => this.handleOpen()}
54+
>
55+
<IconBug />
56+
</IconButton>
57+
<Dialog
58+
title="Dialog With Actions"
59+
actions={actions}
60+
modal={false}
61+
open={this.state.open}
62+
onRequestClose={this.handleClose}
63+
>
64+
The actions in this window were passed in as an array of React objects.
65+
</Dialog>
66+
</div>
67+
);
68+
}
69+
}

src/components/Footer/Cheese.jsx

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import React from 'react';
2+
import Dialog from 'material-ui/Dialog';
3+
import FlatButton from 'material-ui/FlatButton';
4+
import IconButton from 'material-ui/IconButton';
5+
import styles from './Footer.css';
6+
7+
import {IconCheese} from '../Icons';
8+
9+
/**
10+
* Dialog with action buttons. The actions are passed in as an array of React objects,
11+
* in this example [FlatButtons](/#/components/flat-button).
12+
*
13+
* You can also close this dialog by clicking outside the dialog, or with the 'Esc' key.
14+
*/
15+
export default class Cheese extends React.Component {
16+
constructor(props) {
17+
super(props)
18+
this.handleOpen = this.handleOpen.bind(this)
19+
this.handleClose = this.handleClose.bind(this)
20+
this.handleCheese = this.handleCheese.bind(this)
21+
22+
this.state = {
23+
open: false,
24+
cheese: false,
25+
};
26+
}
27+
28+
handleOpen() {
29+
this.setState({open: true});
30+
};
31+
32+
handleClose() {
33+
this.setState({open: false});
34+
};
35+
36+
handleCheese() {
37+
this.setState({
38+
cheese: true,
39+
})
40+
}
41+
42+
render() {
43+
const actions = [
44+
<FlatButton
45+
label="扫码赞助之后请点这里"
46+
primary={true}
47+
keyboardFocused={true}
48+
onTouchTap={this.handleCheese}
49+
/>,
50+
<FlatButton
51+
label="下次再说"
52+
primary={true}
53+
onTouchTap={this.handleClose}
54+
/>,
55+
];
56+
57+
return (
58+
<div className={styles.btn}>
59+
<IconButton
60+
tooltip="给予赞助"
61+
tooltipPosition="top-right"
62+
onClick={() => this.handleOpen()}
63+
>
64+
<IconCheese />
65+
</IconButton>
66+
<Dialog
67+
actions={actions}
68+
modal={false}
69+
open={this.state.open}
70+
onRequestClose={this.handleClose}
71+
bodyClassName={styles.outerClass}
72+
contentClassName={styles.contentClass}
73+
overlayClassName={styles.overlayClass}
74+
>
75+
<div className={styles.cheeseContent}>
76+
<section>
77+
<h2>需要你的帮助!</h2>
78+
<p>RUARUA.live是无盈利的开源站点,如果您对网站有兴趣,希望网站持续提供优质资源, 也许您能帮我们分担一点服务器费用...</p>
79+
</section>
80+
<section className={styles.payContent}>
81+
<section className={styles.cheeseSvgBox}>
82+
<IconCheese />
83+
</section>
84+
<p>本月目标: <strong>245</strong> rmb(服务器费用)</p>
85+
<p>完成目标: <strong>0</strong> rmb</p>
86+
<section className={styles.payBox}>
87+
<div>
88+
<img src={require('../../../assets/ali_pay.jpg')} alt=""/>
89+
<p>支付宝</p>
90+
</div>
91+
<div>
92+
<img src={require('../../../assets/wechat_pay.jpg')} alt=""/>
93+
<p>微信</p>
94+
</div>
95+
96+
</section>
97+
</section>
98+
</div>
99+
</Dialog>
100+
</div>
101+
);
102+
}
103+
}

0 commit comments

Comments
 (0)