forked from alibaba/ice
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDataOverview.jsx
More file actions
100 lines (96 loc) · 2.33 KB
/
DataOverview.jsx
File metadata and controls
100 lines (96 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import Container from '@icedesign/container';
import React, { Component } from 'react';
class DataOverview extends Component {
state = {
dataSource: [
{
icon: require('./images/icon1.png'),
title: '昨日内容浏览次数',
total: '567',
},
{
icon: require('./images/icon2.png'),
title: '昨日粉丝数',
total: '80',
},
{
icon: require('./images/icon3.png'),
title: '昨日活跃粉丝数',
total: '89万',
yestodayTrend: 'increase',
yestodayNumber: '700',
weekTrend: 'decrease',
weekNumber: '8000',
},
{
icon: require('./images/icon4.png'),
title: '累计内容发布数',
total: '20',
},
{
icon: require('./images/icon5.png'),
title: '内容健康度',
total: '20',
},
{
icon: require('./images/icon6.png'),
title: '内容质量分',
total: '20',
},
{
icon: require('./images/icon7.png'),
title: '微淘号达人指数',
total: '20',
},
],
};
render() {
return (
<Container style={styles.container}>
{this.state.dataSource.map((data, index) => {
return (
<div key={index} style={styles.overviewItem}>
<div style={styles.overviewItemIcon}>
<img alt={data.title} src={data.icon} style={{ width: 70 }} />
</div>
<div
style={{
paddingLeft: 10,
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<div style={styles.overviewItemTitle}>{data.title}</div>
<div style={styles.overviewItemTotal}>{data.total}</div>
</div>
</div>
);
})}
</Container>
);
}
}
const styles = {
container: {
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
},
overviewItem: {
flex: '0 0 25%',
display: 'flex',
padding: '10px 0',
},
overviewItemTitle: {
fontSize: 12,
lineHeight: '20px',
color: '#999',
},
overviewItemTotal: {
fontSize: 24,
lineHeight: '30px',
color: '#333',
},
};
export default DataOverview;