-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommunity.js
160 lines (160 loc) · 5.18 KB
/
community.js
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import React, { Component, Dimensions } from 'react';
import { Image } from 'react-native';
import {
View, Title, Container, Header, Content, Card, CardItem, Thumbnail, Text, Button, Icon, Left, Body, Right
} from 'native-base';
import { ImageBackground } from 'react-native';
// const SLIDER_HEIGHT = Dimensions.get('window').height - 250;
const SLIDER_HEIGHT = 500;
export default class community extends Component {
constructor(props) {
super(props);
this.state = {
BG: null,
skin: null,
link: "连接中",
}
}
componentDidMount() {
this.timer = setTimeout(() => {
alert("连接社区失败!\n请检查与服务器的网络连接!");
// this.timers && clearInterval(this.timers);
}, 2000);
this.timers = setInterval(() => {
if (this.state.link == "连接中") this.setState({ link: "连接中." });
else if (this.state.link == "连接中.") this.setState({ link: "连接中.." });
else if (this.state.link == "连接中..") this.setState({ link: "连接中..." });
else this.setState({ link: "连接中" });
}, 300);
}
componentWillUnmount() {
this.timer && clearInterval(this.timer);
this.timers && clearInterval(this.timers);
}
render() {
let time = this.state;
const { navigation } = this.props;
return (
<Container>
<Header
style={{ backgroundColor: "#00bfff" }}
androidStatusBarColor="#00bfff"
iosBarStyle="light-content"
>
<Left>
<Button transparent onPress={() => navigation.openDrawer()}>
<Icon name='menu' />
</Button>
</Left>
<Body>
<Title>社区</Title>
</Body>
<Right />
</Header>
<Content>
<Card>
<CardItem>
<Left>
<Thumbnail source={require('./o1.jpg')} />
<Body>
<Text>Trickle-Up 开发组</Text>
<Text note>分享自 自定义主题</Text>
</Body>
</Left>
</CardItem>
<CardItem cardBody>
<Image source={require('./ff.jpg')} style={{ height: 200, width: null, flex: 1 }} />
</CardItem>
<CardItem>
<Left>
<Button transparent>
<Icon active name="thumbs-up" />
<Text>12 喜欢</Text>
</Button>
</Left>
<Body>
<Button transparent>
<Icon active name="chatbubbles" />
<Text>4 评论</Text>
</Button>
</Body>
<Right>
<Text>11小时前</Text>
</Right>
</CardItem>
</Card>
<Card>
<CardItem>
<Left>
<Thumbnail source={require('./o1.jpg')} />
<Body>
<Text>Trickle-Up 开发组</Text>
<Text note>分享自 愿望单</Text>
</Body>
</Left>
</CardItem>
<CardItem cardBody>
<Image source={require('./ss.jpg')} style={{ height: 200, width: null, flex: 1 }} />
</CardItem>
<CardItem>
<Left>
<Button transparent>
<Icon active name="thumbs-up" />
<Text>12 喜欢</Text>
</Button>
</Left>
<Body>
<Button transparent>
<Icon active name="chatbubbles" />
<Text>4 评论</Text>
</Button>
</Body>
<Right>
<Text>11小时前</Text>
</Right>
</CardItem>
</Card>
<Card>
<CardItem>
<Left>
<Thumbnail source={require('./o1.jpg')} />
<Body>
<Text>Admin</Text>
<Text note>咕咕咕</Text>
</Body>
</Left>
</CardItem>
<CardItem cardBody>
<Image source={require('./o1.jpg')} style={{ height: 200, width: null, flex: 1 }} />
</CardItem>
<CardItem>
<Left>
<Button transparent>
<Icon active name="thumbs-up" />
<Text>12 喜欢</Text>
</Button>
</Left>
<Body>
<Button transparent>
<Icon active name="chatbubbles" />
<Text>4 评论</Text>
</Button>
</Body>
<Right>
<Text>11小时前</Text>
</Right>
</CardItem>
</Card>
</Content>
{/* <View style={{
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'transparent',
height: SLIDER_HEIGHT,
}}>
<Text>{this.state.link}</Text>
</View> */}
</Container>
);
}
}