Skip to content

Commit a740069

Browse files
committed
加入了空页面的处理
1 parent d513a00 commit a740069

File tree

9 files changed

+61
-45
lines changed

9 files changed

+61
-45
lines changed

app/component/CommonList.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ const styles = {
204204
fontSize: 14,
205205
fontWeight: '500',
206206
color: Colors.blackColor,
207-
width: WindowWidth - 60 - 80
207+
flexShrink: 1,
208+
marginRight: 8
208209
},
209210
create: {
210211
fontSize: 10,

app/other/Colors.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export const separatorColor = '#DCDCDC'
44
export const blackColor = '#424242'
55
export const grayColor = '#ABABAB'
6+
export const lightGrayColor = '#D2D2D2'
67
export const placeholderColor = '#F4F4F4'
78
export const blueColor = '#4990E2'
89
export const borderColor = 'rgba(66,66,66,0.1)'

app/pages/ReadMessagesRender.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import Store from 'react-native-simple-store'
1717
import HTMLView from 'react-native-htmlview'
1818
import Markdown from 'react-native-simple-markdown'
1919

20-
const WindowWidth = Dimensions.get('window').width
21-
2220
export default class ReadMessagesRender extends Component {
2321
constructor(props) {
2422
super(props);
@@ -38,13 +36,13 @@ export default class ReadMessagesRender extends Component {
3836

3937
_emptyComponent() {
4038
return (
41-
<View style={[styles.emptyView, {height: this.state.viewHeight}]}>
42-
<Image source={require('../assets/images/messageEmpty.png')}/>
43-
<Text style={styles.emptyText}>{'暂时还没有消息'}</Text>
39+
<View style={styles.emptyView}>
40+
<Text style={styles.emptyText}>{'暂无消息'}</Text>
4441
</View>
4542
)
4643
}
4744

45+
4846
_updateData(token) {
4947
fetch(Api.messages + "?accesstoken=" + token + "&mdrender=false")
5048
.then((response) => response.json())
@@ -66,14 +64,13 @@ export default class ReadMessagesRender extends Component {
6664
renderItem={({item, index}) => this.renderRow(item, index)}
6765
keyExtractor={item => item.id}
6866
ItemSeparatorComponent={() => this.renderSeparator()}
69-
ListEmptyComponent={() => this._emptyComponent()}
7067
style={styles.listView}
7168
/>
7269
)
7370
}
7471
else {
7572
return(
76-
<View/>
73+
this._emptyComponent()
7774
)
7875
}
7976
}
@@ -213,7 +210,7 @@ const styles = {
213210
flexDirection: 'column',
214211
justifyContent: 'flex-start',
215212
alignItems: 'flex-start',
216-
width: WindowWidth - 50 - 16 - 16 - 16
213+
flexShrink: 1
217214
},
218215
title: {
219216
fontSize: 12,
@@ -250,7 +247,7 @@ const styles = {
250247
backgroundColor: 'white'
251248
},
252249
emptyText: {
253-
fontSize: 14,
254-
color: Colors.blackColor
250+
fontSize: 17,
251+
color: Colors.lightGrayColor
255252
}
256253
}

app/pages/RecentRepliesRender.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import * as Colors from '../other/Colors'
1414
import Api from '../util/Api'
1515
import moment from 'moment'
1616

17-
const WindowWidth = Dimensions.get('window').width
18-
1917
export default class RecentRepliesRender extends Component {
2018
constructor(props) {
2119
super(props);
@@ -118,7 +116,7 @@ const styles = {
118116
fontSize: 14,
119117
fontWeight: '500',
120118
color: Colors.blackColor,
121-
width: WindowWidth - 50 - 16 - 16 - 16
119+
flexShrink: 1
122120
},
123121
create: {
124122
fontSize: 10,

app/pages/ReplyListRender.js

+21-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,19 @@ export default class DetailRender extends Component {
4242
}
4343
else {
4444
return(
45-
<View/>
45+
this._emptyComponent()
4646
)
4747
}
4848
}
49+
50+
_emptyComponent() {
51+
return (
52+
<View style={[styles.emptyView, {height: this.state.viewHeight}]}>
53+
<Text style={styles.emptyText}>{'暂无消息'}</Text>
54+
</View>
55+
)
56+
}
57+
4958
_onLinkPress(url){
5059
if (url.startsWith('/user/')) {
5160
let loginname = url.substr(url.lastIndexOf('/') + 1);
@@ -175,5 +184,15 @@ const styles = {
175184
relativeText: {
176185
fontSize: 10,
177186
color: Colors.grayColor
178-
}
187+
},
188+
emptyText: {
189+
fontSize: 17,
190+
color: Colors.lightGrayColor
191+
},
192+
emptyView: {
193+
flex:1,
194+
alignItems: 'center',
195+
justifyContent: 'center',
196+
backgroundColor: 'white'
197+
},
179198
}

app/pages/TopicCollectRender.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import * as Colors from '../other/Colors'
1313
import Api from '../util/Api'
1414
import moment from 'moment'
1515

16-
const WindowWidth = Dimensions.get('window').width
17-
1816
export default class TopicCollectRender extends Component {
1917
static navigatorStyle = {
2018
navBarBackgroundColor: 'white',
@@ -169,7 +167,7 @@ const styles = {
169167
fontSize: 14,
170168
fontWeight: '500',
171169
color: Colors.blackColor,
172-
width: WindowWidth - 60 - 80
170+
flexShrink: 1
173171
},
174172
create: {
175173
fontSize: 10,

app/pages/UnrenderMessagesRender.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import Store from 'react-native-simple-store'
1717
import HTMLView from 'react-native-htmlview'
1818
import Markdown from 'react-native-simple-markdown'
1919

20-
const ScreenSize = Dimensions.get('window')
21-
2220
export default class UnrenderMessagesRender extends Component {
2321
constructor(props) {
2422
super(props);
@@ -53,8 +51,7 @@ export default class UnrenderMessagesRender extends Component {
5351
_emptyComponent() {
5452
return (
5553
<View style={[styles.emptyView, {height: this.state.viewHeight}]}>
56-
<Image source={require('../assets/images/messageEmpty.png')}/>
57-
<Text style={styles.emptyText}>{'暂时还没有消息'}</Text>
54+
<Text style={styles.emptyText}>{'暂无消息'}</Text>
5855
</View>
5956
)
6057
}
@@ -221,7 +218,7 @@ const styles = {
221218
flexDirection: 'column',
222219
justifyContent: 'flex-start',
223220
alignItems: 'flex-start',
224-
width: ScreenSize.width - 50 - 16 - 16 - 16
221+
flexShrink: 1
225222
},
226223
title: {
227224
fontSize: 12,
@@ -255,11 +252,10 @@ const styles = {
255252
flex:1,
256253
alignItems: 'center',
257254
justifyContent: 'center',
258-
backgroundColor: 'white',
259-
height: ScreenSize.height - 64
255+
backgroundColor: 'white'
260256
},
261257
emptyText: {
262-
fontSize: 14,
263-
color: Colors.blackColor
258+
fontSize: 17,
259+
color: Colors.lightGrayColor
264260
}
265261
}

ios/Noder.xcodeproj/project.pbxproj

+22-14
Original file line numberDiff line numberDiff line change
@@ -690,33 +690,33 @@
690690
DF39B7451F9F102200E0CF7A /* HTMLNode */ = {
691691
isa = PBXGroup;
692692
children = (
693+
DF39B7561F9F102200E0CF7A /* LCLiTextNode.h */,
693694
DF39B7461F9F102200E0CF7A /* LCLiTextNode.m */,
694-
DF39B7471F9F102200E0CF7A /* LCCodeDisplayNode.m */,
695+
DF39B7541F9F102200E0CF7A /* LCQuoteDisplayNode.h */,
695696
DF39B7481F9F102200E0CF7A /* LCQuoteDisplayNode.m */,
696-
DF39B7491F9F102200E0CF7A /* NSString+LCAdditional.h */,
697-
DF39B74A1F9F102200E0CF7A /* LCLIDisplayNode.h */,
698-
DF39B74B1F9F102200E0CF7A /* LCPTextNode.h */,
699-
DF39B74C1F9F102200E0CF7A /* LCHTextNode.h */,
700-
DF39B74D1F9F102200E0CF7A /* LCPDisplayNode.h */,
701-
DF39B74E1F9F102200E0CF7A /* NSMutableAttributedString+LCLineSpace.m */,
702-
DF39B74F1F9F102200E0CF7A /* LCULDisplayNode.h */,
703-
DF39B7501F9F102200E0CF7A /* LCHtmlNode.h */,
697+
DF39B75F1F9F102200E0CF7A /* LCCodeTextNode.h */,
704698
DF39B7511F9F102200E0CF7A /* LCCodeTextNode.m */,
705-
DF39B7521F9F102200E0CF7A /* LCNetworkImageNode.h */,
706699
DF39B7531F9F102200E0CF7A /* UIColor+LCColor.h */,
707-
DF39B7541F9F102200E0CF7A /* LCQuoteDisplayNode.h */,
700+
DF39B75D1F9F102200E0CF7A /* UIColor+LCColor.m */,
708701
DF39B7551F9F102200E0CF7A /* LCCodeDisplayNode.h */,
709-
DF39B7561F9F102200E0CF7A /* LCLiTextNode.h */,
702+
DF39B7471F9F102200E0CF7A /* LCCodeDisplayNode.m */,
703+
DF39B74A1F9F102200E0CF7A /* LCLIDisplayNode.h */,
710704
DF39B7571F9F102200E0CF7A /* LCLIDisplayNode.m */,
705+
DF39B7491F9F102200E0CF7A /* NSString+LCAdditional.h */,
711706
DF39B7581F9F102200E0CF7A /* NSString+LCAdditional.m */,
712707
DF39B7591F9F102200E0CF7A /* NSMutableAttributedString+LCLineSpace.h */,
708+
DF39B74E1F9F102200E0CF7A /* NSMutableAttributedString+LCLineSpace.m */,
709+
DF39B74D1F9F102200E0CF7A /* LCPDisplayNode.h */,
713710
DF39B75A1F9F102200E0CF7A /* LCPDisplayNode.m */,
711+
DF39B74C1F9F102200E0CF7A /* LCHTextNode.h */,
714712
DF39B75B1F9F102200E0CF7A /* LCHTextNode.m */,
713+
DF39B74B1F9F102200E0CF7A /* LCPTextNode.h */,
715714
DF39B75C1F9F102200E0CF7A /* LCPTextNode.m */,
716-
DF39B75D1F9F102200E0CF7A /* UIColor+LCColor.m */,
715+
DF39B7521F9F102200E0CF7A /* LCNetworkImageNode.h */,
717716
DF39B75E1F9F102200E0CF7A /* LCNetworkImageNode.m */,
718-
DF39B75F1F9F102200E0CF7A /* LCCodeTextNode.h */,
717+
DF39B7501F9F102200E0CF7A /* LCHtmlNode.h */,
719718
DF39B7601F9F102200E0CF7A /* LCHtmlNode.m */,
719+
DF39B74F1F9F102200E0CF7A /* LCULDisplayNode.h */,
720720
DF39B7611F9F102200E0CF7A /* LCULDisplayNode.m */,
721721
);
722722
name = HTMLNode;
@@ -812,8 +812,12 @@
812812
TargetAttributes = {
813813
00E356ED1AD99517003FC87E = {
814814
CreatedOnToolsVersion = 6.2;
815+
DevelopmentTeam = U2HU62KF5U;
815816
TestTargetID = 13B07F861A680F5B00A75B9A;
816817
};
818+
13B07F861A680F5B00A75B9A = {
819+
DevelopmentTeam = U2HU62KF5U;
820+
};
817821
2D02E47A1E0B4A5D006451C7 = {
818822
CreatedOnToolsVersion = 8.2.1;
819823
ProvisioningStyle = Automatic;
@@ -1345,6 +1349,7 @@
13451349
isa = XCBuildConfiguration;
13461350
buildSettings = {
13471351
BUNDLE_LOADER = "$(TEST_HOST)";
1352+
DEVELOPMENT_TEAM = U2HU62KF5U;
13481353
GCC_PREPROCESSOR_DEFINITIONS = (
13491354
"DEBUG=1",
13501355
"$(inherited)",
@@ -1376,6 +1381,7 @@
13761381
buildSettings = {
13771382
BUNDLE_LOADER = "$(TEST_HOST)";
13781383
COPY_PHASE_STRIP = NO;
1384+
DEVELOPMENT_TEAM = U2HU62KF5U;
13791385
HEADER_SEARCH_PATHS = (
13801386
"$(inherited)",
13811387
"$(SRCROOT)/../node_modules/react-native-camera/ios",
@@ -1405,6 +1411,7 @@
14051411
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
14061412
CURRENT_PROJECT_VERSION = 1;
14071413
DEAD_CODE_STRIPPING = NO;
1414+
DEVELOPMENT_TEAM = U2HU62KF5U;
14081415
HEADER_SEARCH_PATHS = (
14091416
"$(inherited)",
14101417
"$(SRCROOT)/../node_modules/react-native-camera/ios",
@@ -1428,6 +1435,7 @@
14281435
buildSettings = {
14291436
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
14301437
CURRENT_PROJECT_VERSION = 1;
1438+
DEVELOPMENT_TEAM = U2HU62KF5U;
14311439
HEADER_SEARCH_PATHS = (
14321440
"$(inherited)",
14331441
"$(SRCROOT)/../node_modules/react-native-camera/ios",

ios/Noder/HTMLNode/LCHtmlNode.m

+1-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ - (void)textNode:(ASTextNode *)richTextNode tappedLinkAttribute:(NSString *)attr
154154
NSString *urlString = URL.absoluteString;
155155
if ([urlString hasPrefix:@"/user/"]) {
156156
if (self.clickUserLinkBlock) {
157-
self.clickUserLinkBlock(@{
158-
@"loginname" : [URL lastPathComponent],
159-
});
157+
self.clickUserLinkBlock(@{@"loginname" : [URL lastPathComponent],});
160158
}
161159
}
162160
else{

0 commit comments

Comments
 (0)