Merge branch 'local' into develop
Showing
11 changed files
with
266 additions
and
115 deletions
@@ -69,13 +69,16 @@ export default class LoadingIndicator extends Component { | @@ -69,13 +69,16 @@ export default class LoadingIndicator extends Component { | ||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | +let {width, height} = Dimensions.get('window'); | ||
73 | +let navbarHeight = (Platform.OS === 'android') ? 50 : 64; | ||
74 | + | ||
72 | const styles = StyleSheet.create({ | 75 | const styles = StyleSheet.create({ |
73 | container: { | 76 | container: { |
74 | position: 'absolute', | 77 | position: 'absolute', |
75 | backgroundColor: 'transparent', | 78 | backgroundColor: 'transparent', |
76 | justifyContent: 'center', | 79 | justifyContent: 'center', |
77 | alignItems: 'center', | 80 | alignItems: 'center', |
78 | - top: 0, | 81 | + top: -navbarHeight, |
79 | bottom: 0, | 82 | bottom: 0, |
80 | left: 0, | 83 | left: 0, |
81 | right: 0, | 84 | right: 0, |
@@ -270,7 +270,7 @@ export default class Home extends React.Component { | @@ -270,7 +270,7 @@ export default class Home extends React.Component { | ||
270 | } | 270 | } |
271 | 271 | ||
272 | render() { | 272 | render() { |
273 | - let {progressing, banner, notice, section, recommendation, user, endReached, isRefreshing, isLoadingMore, isFetching} = this.props; | 273 | + let {progressing, banner, notice, section, recommendation, user, endReached, isRefreshing, isLoadingMore, isFetching, isUserStateFetching} = this.props; |
274 | let dataSource = { | 274 | let dataSource = { |
275 | progressing: progressing.toArray(), | 275 | progressing: progressing.toArray(), |
276 | banner: banner.toArray(), | 276 | banner: banner.toArray(), |
@@ -313,7 +313,7 @@ export default class Home extends React.Component { | @@ -313,7 +313,7 @@ export default class Home extends React.Component { | ||
313 | }} | 313 | }} |
314 | /> | 314 | /> |
315 | <LoadingIndicator | 315 | <LoadingIndicator |
316 | - isVisible={false} | 316 | + isVisible={isUserStateFetching} |
317 | /> | 317 | /> |
318 | <SuperMan | 318 | <SuperMan |
319 | uid={user.uid} | 319 | uid={user.uid} |
@@ -8,11 +8,10 @@ import Notice from '../home/Notice'; | @@ -8,11 +8,10 @@ import Notice from '../home/Notice'; | ||
8 | import SectionTabBar from './SectionTabBar'; | 8 | import SectionTabBar from './SectionTabBar'; |
9 | import ScrollableTabView, {DefaultTabBar} from 'react-native-scrollable-tab-view'; | 9 | import ScrollableTabView, {DefaultTabBar} from 'react-native-scrollable-tab-view'; |
10 | import SectionList from './SectionList'; | 10 | import SectionList from './SectionList'; |
11 | +import LoadingIndicator from '../../../common/components/LoadingIndicator'; | ||
11 | import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator'; | 12 | import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator'; |
12 | import UploadProgress from '../home/UploadProgress'; | 13 | import UploadProgress from '../home/UploadProgress'; |
13 | import SuperMan from '../home/SuperMan'; | 14 | import SuperMan from '../home/SuperMan'; |
14 | -import TimerMixin from 'react-timer-mixin'; | ||
15 | -import {Actions} from 'react-native-router-flux'; | ||
16 | 15 | ||
17 | const { | 16 | const { |
18 | View, | 17 | View, |
@@ -294,7 +293,7 @@ export default class Section extends React.Component { | @@ -294,7 +293,7 @@ export default class Section extends React.Component { | ||
294 | } | 293 | } |
295 | 294 | ||
296 | render() { | 295 | render() { |
297 | - let {header, notice, list, user, endReached, isRefreshing, isLoadingMore, isFetching} = this.props; | 296 | + let {header, notice, list, user, endReached, isRefreshing, isLoadingMore, isFetching, isUserStateFetching} = this.props; |
298 | let dataSource = { | 297 | let dataSource = { |
299 | progressing: this.props.progressing.toArray(), | 298 | progressing: this.props.progressing.toArray(), |
300 | header: header.toArray(), | 299 | header: header.toArray(), |
@@ -335,6 +334,9 @@ export default class Section extends React.Component { | @@ -335,6 +334,9 @@ export default class Section extends React.Component { | ||
335 | } | 334 | } |
336 | }} | 335 | }} |
337 | /> | 336 | /> |
337 | + <LoadingIndicator | ||
338 | + isVisible={isUserStateFetching} | ||
339 | + /> | ||
338 | <SuperMan | 340 | <SuperMan |
339 | uid={user.uid} | 341 | uid={user.uid} |
340 | avatar={user.avatar} | 342 | avatar={user.avatar} |
1 | +import React, {Component} from 'react'; | ||
2 | +import { | ||
3 | + View, | ||
4 | + Text, | ||
5 | + Image, | ||
6 | + TouchableOpacity, | ||
7 | + StyleSheet, | ||
8 | + Dimensions, | ||
9 | +} from 'react-native' | ||
10 | + | ||
11 | +import UserBrief from '../home/UserBrief'; | ||
12 | +import SubjectContent from './SubjectContent'; | ||
13 | + | ||
14 | +let {width, height} = Dimensions.get('window'); | ||
15 | + | ||
16 | +export default class SPCommentCell extends Component { | ||
17 | + constructor(props) { | ||
18 | + super(props); | ||
19 | + | ||
20 | + this.renderDeleteCommentButton = this.renderDeleteCommentButton.bind(this); | ||
21 | + } | ||
22 | + | ||
23 | + renderDeleteCommentButton() { | ||
24 | + let {data, cidFrom} = this.props; | ||
25 | + let {LZ, cidTo, commentId} = data; | ||
26 | + if (LZ || (cidTo == cidFrom)) { | ||
27 | + return ( | ||
28 | + <TouchableOpacity | ||
29 | + style={styles.delete} | ||
30 | + onPress={()=>{ | ||
31 | + this.props.onPressDeleteComment && this.props.onPressDeleteComment(commentId); | ||
32 | + }} | ||
33 | + > | ||
34 | + <Image | ||
35 | + style={styles.deleteImage} | ||
36 | + resizeMode={'contain'} | ||
37 | + source={require('../../images/posting/ic_dian.png')} | ||
38 | + /> | ||
39 | + </TouchableOpacity> | ||
40 | + ) | ||
41 | + } else { | ||
42 | + return null; | ||
43 | + } | ||
44 | + } | ||
45 | + | ||
46 | + render() { | ||
47 | + let {headIcon, nickName, timeago, LZ, cidTo, commentId, blocks, replyTo} = this.props.data; | ||
48 | + return ( | ||
49 | + <TouchableOpacity | ||
50 | + style={styles.container} | ||
51 | + onPress={() => { | ||
52 | + this.props.onPressComment && this.props.onPressComment(); | ||
53 | + }} | ||
54 | + > | ||
55 | + <View> | ||
56 | + <View style={styles.header}> | ||
57 | + <View style={styles.userContainer}> | ||
58 | + <UserBrief | ||
59 | + avatar={headIcon} | ||
60 | + name={nickName} | ||
61 | + timeago={timeago} | ||
62 | + isOwner={LZ} | ||
63 | + onPressAvatar={this.props.onPressAvatar} | ||
64 | + /> | ||
65 | + </View> | ||
66 | + {this.renderDeleteCommentButton(cidTo, commentId)} | ||
67 | + </View> | ||
68 | + | ||
69 | + <SubjectContent | ||
70 | + contentWidth={width - 65} | ||
71 | + left={20} | ||
72 | + blocks={blocks} | ||
73 | + replyTo={replyTo} | ||
74 | + onPressAvatar={this.props.onPressAvatar} | ||
75 | + /> | ||
76 | + <View style={styles.separator}/> | ||
77 | + </View> | ||
78 | + </TouchableOpacity> | ||
79 | + ); | ||
80 | + } | ||
81 | +} | ||
82 | + | ||
83 | +const styles = StyleSheet.create({ | ||
84 | + container: { | ||
85 | + paddingTop: 10, | ||
86 | + paddingLeft: 15, | ||
87 | + paddingRight: 15, | ||
88 | + backgroundColor: 'white', | ||
89 | + }, | ||
90 | + separator: { | ||
91 | + backgroundColor: '#a0a0a0', | ||
92 | + height: 0.5, | ||
93 | + width: width-30, | ||
94 | + }, | ||
95 | + header: { | ||
96 | + flexDirection: 'row', | ||
97 | + }, | ||
98 | + userContainer: { | ||
99 | + flex: 1, | ||
100 | + flexDirection: 'row', | ||
101 | + alignItems: 'center' | ||
102 | + }, | ||
103 | + delete: { | ||
104 | + width: 80, | ||
105 | + height: 30, | ||
106 | + alignItems: 'flex-end', | ||
107 | + }, | ||
108 | + deleteImage: { | ||
109 | + width: 20, | ||
110 | + height: 20, | ||
111 | + }, | ||
112 | +}); |
@@ -17,7 +17,7 @@ export default class SPHeaderCell extends Component { | @@ -17,7 +17,7 @@ export default class SPHeaderCell extends Component { | ||
17 | 17 | ||
18 | render() { | 18 | render() { |
19 | let {avatar, nickName, timeago, isOwner, sectionName, showLZ} = this.props; | 19 | let {avatar, nickName, timeago, isOwner, sectionName, showLZ} = this.props; |
20 | - return( | 20 | + return ( |
21 | <View style={styles.container}> | 21 | <View style={styles.container}> |
22 | <View style={styles.top}> | 22 | <View style={styles.top}> |
23 | <UserBrief | 23 | <UserBrief |
@@ -23,8 +23,8 @@ export default class SPLikeCell extends React.Component { | @@ -23,8 +23,8 @@ export default class SPLikeCell extends React.Component { | ||
23 | headIcon: React.PropTypes.string, | 23 | headIcon: React.PropTypes.string, |
24 | uid: React.PropTypes.number, | 24 | uid: React.PropTypes.number, |
25 | })), | 25 | })), |
26 | - like: React.PropTypes.number, | ||
27 | - browse: React.PropTypes.number, | 26 | + like: React.PropTypes.string, |
27 | + browse: React.PropTypes.string, | ||
28 | onPressLikeCell: React.PropTypes.func, | 28 | onPressLikeCell: React.PropTypes.func, |
29 | }; | 29 | }; |
30 | 30 |
1 | +'use strict'; | ||
2 | + | ||
3 | +import React from 'react'; | ||
4 | +import ReactNative from 'react-native'; | ||
5 | +import ImmutablePropTypes from 'react-immutable-proptypes'; | ||
6 | +import SlicedImage from '../../../common/components/SlicedImage'; | ||
7 | + | ||
8 | +const { | ||
9 | + View, | ||
10 | + Text, | ||
11 | + Image, | ||
12 | + TouchableOpacity, | ||
13 | + StyleSheet, | ||
14 | + Dimensions, | ||
15 | +} = ReactNative; | ||
16 | + | ||
17 | +export default class SPShareGoodsCell extends React.Component { | ||
18 | + | ||
19 | + constructor(props) { | ||
20 | + super (props); | ||
21 | + | ||
22 | + } | ||
23 | + | ||
24 | + render() { | ||
25 | + let {goodsImage, productName, salesPrice} = this.props.data; | ||
26 | + return ( | ||
27 | + <TouchableOpacity onPress={() => { | ||
28 | + this.props.onPressShareGoods && this.props.onPressShareGoods(); | ||
29 | + }}> | ||
30 | + <View style={styles.container}> | ||
31 | + <SlicedImage style={styles.shareGoodsImage} source={{uri: goodsImage}}/> | ||
32 | + <View style={styles.shareGoodsRightPannel}> | ||
33 | + <Text style={styles.productNameText}>{productName}</Text> | ||
34 | + <Text style={styles.productPriceText}>{'¥' + salesPrice}</Text> | ||
35 | + </View> | ||
36 | + </View> | ||
37 | + </TouchableOpacity> | ||
38 | + ); | ||
39 | + } | ||
40 | +} | ||
41 | + | ||
42 | +let {width, height} = Dimensions.get('window'); | ||
43 | +let lineWidth = width - 30; | ||
44 | + | ||
45 | +let styles = StyleSheet.create({ | ||
46 | + container: { | ||
47 | + flexDirection: 'row', | ||
48 | + paddingLeft: 15, | ||
49 | + paddingBottom: 10, | ||
50 | + backgroundColor: 'white', | ||
51 | + }, | ||
52 | + shareGoodsImage: { | ||
53 | + width: 52, | ||
54 | + height: 70, | ||
55 | + backgroundColor:'gray', | ||
56 | + }, | ||
57 | + shareGoodsRightPannel: { | ||
58 | + flexDirection: 'column', | ||
59 | + paddingLeft: 10, | ||
60 | + paddingTop: 5, | ||
61 | + }, | ||
62 | + productNameText: { | ||
63 | + fontSize: 15, | ||
64 | + width: width - 52 - 30, | ||
65 | + }, | ||
66 | + productPriceText: { | ||
67 | + top: 10, | ||
68 | + fontSize: 12, | ||
69 | + color: '#d0021b', | ||
70 | + }, | ||
71 | +}); |
@@ -24,6 +24,9 @@ import PostingService from '../../services/PostingService'; | @@ -24,6 +24,9 @@ import PostingService from '../../services/PostingService'; | ||
24 | import SPHeaderCell from './SPHeaderCell'; | 24 | import SPHeaderCell from './SPHeaderCell'; |
25 | import SubjectContent from './SubjectContent'; | 25 | import SubjectContent from './SubjectContent'; |
26 | import SPLikeCell from './SPLikeCell'; | 26 | import SPLikeCell from './SPLikeCell'; |
27 | +import SPShareGoodsCell from './SPShareGoodsCell'; | ||
28 | +import SPCommentCell from './SPCommentCell'; | ||
29 | +import LoadingIndicator from '../../../common/components/LoadingIndicator'; | ||
27 | import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator'; | 30 | import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator'; |
28 | import AssertsPicker from '../posting/AssertsPicker'; | 31 | import AssertsPicker from '../posting/AssertsPicker'; |
29 | import SlicedImage from '../../../common/components/SlicedImage'; | 32 | import SlicedImage from '../../../common/components/SlicedImage'; |
@@ -64,12 +67,14 @@ export default class SubjectPost extends Component { | @@ -64,12 +67,14 @@ export default class SubjectPost extends Component { | ||
64 | this.renderToolContainer = this.renderToolContainer.bind(this); | 67 | this.renderToolContainer = this.renderToolContainer.bind(this); |
65 | this.someOneToReply = ''; | 68 | this.someOneToReply = ''; |
66 | this.replyToSomeOneElse = this.replyToSomeOneElse.bind(this); | 69 | this.replyToSomeOneElse = this.replyToSomeOneElse.bind(this); |
67 | - this.renderDeleteCommentButton = this.renderDeleteCommentButton.bind(this); | 70 | + |
68 | this.commentId = ''; | 71 | this.commentId = ''; |
69 | this.cidTo = ''; | 72 | this.cidTo = ''; |
70 | this.replyContent=''; | 73 | this.replyContent=''; |
71 | this.commitComment = this.commitComment.bind(this); | 74 | this.commitComment = this.commitComment.bind(this); |
72 | this.cnameTo = ''; | 75 | this.cnameTo = ''; |
76 | + | ||
77 | + this.onPressComment = this.onPressComment.bind(this); | ||
73 | } | 78 | } |
74 | 79 | ||
75 | componentDidMount(){ | 80 | componentDidMount(){ |
@@ -120,7 +125,15 @@ export default class SubjectPost extends Component { | @@ -120,7 +125,15 @@ export default class SubjectPost extends Component { | ||
120 | let targetHeight = height-navbarHeight-0.5- this.boardHeight; | 125 | let targetHeight = height-navbarHeight-0.5- this.boardHeight; |
121 | this.stretchContentInputToHeight(targetHeight, 250); | 126 | this.stretchContentInputToHeight(targetHeight, 250); |
122 | } | 127 | } |
128 | + | ||
123 | render() { | 129 | render() { |
130 | + | ||
131 | + if (this.props.isContentFetching) { | ||
132 | + return <LoadingIndicator | ||
133 | + isVisible={this.props.isContentFetching} | ||
134 | + /> | ||
135 | + } | ||
136 | + | ||
124 | return( | 137 | return( |
125 | <View style={styles.container}> | 138 | <View style={styles.container}> |
126 | <Animated.View | 139 | <Animated.View |
@@ -374,6 +387,7 @@ export default class SubjectPost extends Component { | @@ -374,6 +387,7 @@ export default class SubjectPost extends Component { | ||
374 | this.replyContent = ''; | 387 | this.replyContent = ''; |
375 | this.blurAll(); | 388 | this.blurAll(); |
376 | } | 389 | } |
390 | + | ||
377 | renderRow(rowData, sectionId) { | 391 | renderRow(rowData, sectionId) { |
378 | switch (sectionId) { | 392 | switch (sectionId) { |
379 | case 'header': | 393 | case 'header': |
@@ -407,15 +421,10 @@ export default class SubjectPost extends Component { | @@ -407,15 +421,10 @@ export default class SubjectPost extends Component { | ||
407 | break; | 421 | break; |
408 | case 'shareGoods': | 422 | case 'shareGoods': |
409 | return ( | 423 | return ( |
410 | - <TouchableOpacity onPress={this.props.onPressShareGoods}> | ||
411 | - <View style={styles.shareGoodsContainer}> | ||
412 | - <SlicedImage style={styles.shareGoodsImage} source={{uri:rowData.goodsImage}}/> | ||
413 | - <View style={styles.shareGoodsRightPannel}> | ||
414 | - <Text style={styles.productNameText}>{rowData.productName}</Text> | ||
415 | - <Text style={styles.productPriceText}>{'¥'+rowData.salesPrice}</Text> | ||
416 | - </View> | ||
417 | - </View> | ||
418 | - </TouchableOpacity> | 424 | + <SPShareGoodsCell |
425 | + data={rowData} | ||
426 | + onPressShareGoods={this.props.onPressShareGoods} | ||
427 | + /> | ||
419 | ); | 428 | ); |
420 | break; | 429 | break; |
421 | case 'like': | 430 | case 'like': |
@@ -432,63 +441,14 @@ export default class SubjectPost extends Component { | @@ -432,63 +441,14 @@ export default class SubjectPost extends Component { | ||
432 | break; | 441 | break; |
433 | case 'comments': | 442 | case 'comments': |
434 | return ( | 443 | return ( |
435 | - <TouchableOpacity | ||
436 | - style={styles.commentContainer} | ||
437 | - onPress={ | ||
438 | - ()=> { | ||
439 | - this.cidTo = rowData.cidTo; | ||
440 | - this.cnameTo = rowData.nickName; | ||
441 | - this.commentId = rowData.commentId; | ||
442 | - NativeModules.YH_CommunityHelper.uid() | ||
443 | - .then(uid => { | ||
444 | - new PostingService().getPostUser(uid).then(json => { | ||
445 | - if (json.forbidSpeaking === 'Y') { | ||
446 | - Alert.alert('抱歉','您暂时被禁言,请等待禁言解除哦~'); | ||
447 | - } else { | ||
448 | - this.replyToSomeOneElse(rowData.nickName); | ||
449 | - } | ||
450 | - }).catch(error => { | ||
451 | - this.replyToSomeOneElse(rowData.nickName); | ||
452 | - }) | ||
453 | - }) | ||
454 | - .catch(error => { | ||
455 | - NativeModules.YH_CommunityHelper.login() | ||
456 | - .then(uid => { | ||
457 | - new PostingService().getPostUser(uid).then(json => { | ||
458 | - if (json.forbidSpeaking === 'Y') { | ||
459 | - Alert.alert('抱歉','您暂时被禁言,请等待禁言解除哦~'); | ||
460 | - } else { | ||
461 | - this.replyToSomeOneElse(rowData.nickName); | ||
462 | - } | ||
463 | - }).catch(error => { | ||
464 | - this.replyToSomeOneElse(rowData.nickName); | ||
465 | - }) | ||
466 | - | ||
467 | - }); | ||
468 | - }); | ||
469 | - } | ||
470 | - } | ||
471 | - > | ||
472 | - <View> | ||
473 | - <View style={{flexDirection:'row'}}> | ||
474 | - <View style={{flex:1,flexDirection: 'row',alignItems:'center'}}> | ||
475 | - <UserBrief | ||
476 | - avatar={rowData.headIcon} | ||
477 | - name={rowData.nickName} | ||
478 | - timeago={rowData.timeago} | ||
479 | - isOwner={rowData.LZ} | ||
480 | - onPressAvatar={() => { | ||
481 | - this.props.onPressAvatar && this.props.onPressAvatar(); | ||
482 | - }} | ||
483 | - /> | ||
484 | - </View> | ||
485 | - {this.renderDeleteCommentButton(rowData.cidTo,rowData.commentId)} | ||
486 | - </View> | ||
487 | - | ||
488 | - <SubjectContent contentWidth={width-65} left={20} blocks={rowData.blocks} replyTo={rowData.replyTo} onPressAvatar={this.props.onPressAvatar}/> | ||
489 | - <View style={styles.commentSeparator}/> | ||
490 | - </View> | ||
491 | - </TouchableOpacity> | 444 | + <SPCommentCell |
445 | + data={rowData} | ||
446 | + cidFrom={this.props.cidFrom} | ||
447 | + onPressAvatar={this.props.onPressAvatar} | ||
448 | + onPressComment={() => { | ||
449 | + this.onPressComment(rowData.cidTo, rowData.nickName, rowData.commentId); | ||
450 | + }} | ||
451 | + /> | ||
492 | ); | 452 | ); |
493 | break; | 453 | break; |
494 | default: | 454 | default: |
@@ -497,19 +457,37 @@ export default class SubjectPost extends Component { | @@ -497,19 +457,37 @@ export default class SubjectPost extends Component { | ||
497 | } | 457 | } |
498 | } | 458 | } |
499 | 459 | ||
500 | - renderDeleteCommentButton(commentUserId,id) { | ||
501 | - if (this.props.dataBlob.header[0].LZ||(commentUserId == this.props.cidFrom)) { | ||
502 | - return( | ||
503 | - <TouchableOpacity | ||
504 | - style={{width:80,height:30,alignItems:'flex-end'}} | ||
505 | - onPress={()=>{ | ||
506 | - this.props.onPressDeleteComment&&this.props.onPressDeleteComment(id); | ||
507 | - }} | ||
508 | - > | ||
509 | - <Image style={{width:20,height:20}} resizeMode={'contain'} source={require('../../images/posting/ic_dian.png')}/> | ||
510 | - </TouchableOpacity> | ||
511 | - ) | ||
512 | - } | 460 | + onPressComment(cidTo, nickName, commentId) { |
461 | + this.cidTo = cidTo; | ||
462 | + this.cnameTo = nickName; | ||
463 | + this.commentId = commentId; | ||
464 | + NativeModules.YH_CommunityHelper.uid() | ||
465 | + .then(uid => { | ||
466 | + new PostingService().getPostUser(uid).then(json => { | ||
467 | + if (json.forbidSpeaking === 'Y') { | ||
468 | + Alert.alert('抱歉','您暂时被禁言,请等待禁言解除哦~'); | ||
469 | + } else { | ||
470 | + this.replyToSomeOneElse(nickName); | ||
471 | + } | ||
472 | + }).catch(error => { | ||
473 | + this.replyToSomeOneElse(nickName); | ||
474 | + }) | ||
475 | + }) | ||
476 | + .catch(error => { | ||
477 | + NativeModules.YH_CommunityHelper.login() | ||
478 | + .then(uid => { | ||
479 | + new PostingService().getPostUser(uid).then(json => { | ||
480 | + if (json.forbidSpeaking === 'Y') { | ||
481 | + Alert.alert('抱歉','您暂时被禁言,请等待禁言解除哦~'); | ||
482 | + } else { | ||
483 | + this.replyToSomeOneElse(nickName); | ||
484 | + } | ||
485 | + }).catch(error => { | ||
486 | + this.replyToSomeOneElse(nickName); | ||
487 | + }) | ||
488 | + | ||
489 | + }); | ||
490 | + }); | ||
513 | } | 491 | } |
514 | 492 | ||
515 | replyToSomeOneElse(someOne) { | 493 | replyToSomeOneElse(someOne) { |
@@ -532,17 +510,6 @@ const styles = StyleSheet.create({ | @@ -532,17 +510,6 @@ const styles = StyleSheet.create({ | ||
532 | backgroundColor: 'white', | 510 | backgroundColor: 'white', |
533 | paddingLeft: 15, | 511 | paddingLeft: 15, |
534 | }, | 512 | }, |
535 | - commentContainer: { | ||
536 | - paddingTop: 10, | ||
537 | - paddingLeft: 15, | ||
538 | - paddingRight: 15, | ||
539 | - backgroundColor: 'white', | ||
540 | - }, | ||
541 | - commentSeparator: { | ||
542 | - backgroundColor: '#a0a0a0', | ||
543 | - height: 0.5, | ||
544 | - width: width-30, | ||
545 | - }, | ||
546 | headerRight: { | 513 | headerRight: { |
547 | flex: 1, | 514 | flex: 1, |
548 | flexDirection: 'row', | 515 | flexDirection: 'row', |
@@ -233,6 +233,7 @@ class HomeContainer extends React.Component { | @@ -233,6 +233,7 @@ class HomeContainer extends React.Component { | ||
233 | 233 | ||
234 | let containerStyle = parseInt(this.props.app.container) === 1 ? null : {marginBottom: 64}; | 234 | let containerStyle = parseInt(this.props.app.container) === 1 ? null : {marginBottom: 64}; |
235 | 235 | ||
236 | + | ||
236 | let scrollToTop = false; | 237 | let scrollToTop = false; |
237 | if (this.props.route.scene && this.props.route.scene.sceneKey == 'Posting') { | 238 | if (this.props.route.scene && this.props.route.scene.sceneKey == 'Posting') { |
238 | if (this.props.posting.canSubmit) { | 239 | if (this.props.posting.canSubmit) { |
@@ -240,6 +241,8 @@ class HomeContainer extends React.Component { | @@ -240,6 +241,8 @@ class HomeContainer extends React.Component { | ||
240 | } | 241 | } |
241 | } | 242 | } |
242 | 243 | ||
244 | + let isUserStateFetching = this.props.posting.userState.isFetching && this.props.route.scene.sceneKey == 'Home'; | ||
245 | + | ||
243 | return ( | 246 | return ( |
244 | <View style={[styles.container, containerStyle]}> | 247 | <View style={[styles.container, containerStyle]}> |
245 | <Home | 248 | <Home |
@@ -265,7 +268,6 @@ class HomeContainer extends React.Component { | @@ -265,7 +268,6 @@ class HomeContainer extends React.Component { | ||
265 | onPressLike={this._onPressLike} | 268 | onPressLike={this._onPressLike} |
266 | onRefresh={this._onRefresh} | 269 | onRefresh={this._onRefresh} |
267 | isFetching={recommendation.isFetching} | 270 | isFetching={recommendation.isFetching} |
268 | - ptr={ptr} | ||
269 | endReached={recommendation.endReached} | 271 | endReached={recommendation.endReached} |
270 | isRefreshing={isFetching} | 272 | isRefreshing={isFetching} |
271 | isLoadingMore={!ptr && recommendation.isFetching} | 273 | isLoadingMore={!ptr && recommendation.isFetching} |
@@ -274,8 +276,8 @@ class HomeContainer extends React.Component { | @@ -274,8 +276,8 @@ class HomeContainer extends React.Component { | ||
274 | onUploadRetry={this._onUploadRetry} | 276 | onUploadRetry={this._onUploadRetry} |
275 | onUploadDelete={this._onUploadDelete} | 277 | onUploadDelete={this._onUploadDelete} |
276 | onSaveingTheWorld={this._onSaveingTheWorld} | 278 | onSaveingTheWorld={this._onSaveingTheWorld} |
277 | - ptrError={error} | ||
278 | scrollToTop={scrollToTop} | 279 | scrollToTop={scrollToTop} |
280 | + isUserStateFetching={isUserStateFetching} | ||
279 | /> | 281 | /> |
280 | </View> | 282 | </View> |
281 | ); | 283 | ); |
@@ -145,23 +145,15 @@ class SectionContainer extends React.Component { | @@ -145,23 +145,15 @@ class SectionContainer extends React.Component { | ||
145 | } | 145 | } |
146 | 146 | ||
147 | _onUploadSuccess() { | 147 | _onUploadSuccess() { |
148 | - | ||
149 | this.props.actions.resetState(); | 148 | this.props.actions.resetState(); |
150 | - | ||
151 | - console.log('upload success!'); | ||
152 | } | 149 | } |
153 | 150 | ||
154 | _onUploadRetry() { | 151 | _onUploadRetry() { |
155 | - | ||
156 | - this.props.actions.startPosting(this.props.posting.assets.toJS()); | ||
157 | - | ||
158 | - console.log('upload retry!'); | 152 | + this.props.actions.startPosting(); |
159 | } | 153 | } |
160 | 154 | ||
161 | _onUploadDelete() { | 155 | _onUploadDelete() { |
162 | this.props.actions.resetState(); | 156 | this.props.actions.resetState(); |
163 | - | ||
164 | - console.log('upload delete!'); | ||
165 | } | 157 | } |
166 | 158 | ||
167 | render() { | 159 | render() { |
@@ -217,6 +209,8 @@ class SectionContainer extends React.Component { | @@ -217,6 +209,8 @@ class SectionContainer extends React.Component { | ||
217 | } | 209 | } |
218 | } | 210 | } |
219 | 211 | ||
212 | + let isUserStateFetching = this.props.posting.userState.isFetching && this.props.route.scene.sceneKey == 'Section'; | ||
213 | + | ||
220 | return ( | 214 | return ( |
221 | <View style={styles.container}> | 215 | <View style={styles.container}> |
222 | <Section | 216 | <Section |
@@ -243,6 +237,7 @@ class SectionContainer extends React.Component { | @@ -243,6 +237,7 @@ class SectionContainer extends React.Component { | ||
243 | onEndReached={this._onEndReached} | 237 | onEndReached={this._onEndReached} |
244 | onSaveingTheWorld={this._onSaveingTheWorld} | 238 | onSaveingTheWorld={this._onSaveingTheWorld} |
245 | scrollToTop={scrollToTop} | 239 | scrollToTop={scrollToTop} |
240 | + isUserStateFetching={isUserStateFetching} | ||
246 | /> | 241 | /> |
247 | </View> | 242 | </View> |
248 | ); | 243 | ); |
@@ -229,10 +229,10 @@ class SubjectPostContainer extends Component { | @@ -229,10 +229,10 @@ class SubjectPostContainer extends Component { | ||
229 | like: [likeData], | 229 | like: [likeData], |
230 | comments: item.commentList.toJS(), | 230 | comments: item.commentList.toJS(), |
231 | }; | 231 | }; |
232 | + | ||
232 | return ( | 233 | return ( |
233 | <View style={styles.container}> | 234 | <View style={styles.container}> |
234 | - { | ||
235 | - item.isContentFetching?null:<SubjectPost | 235 | + <SubjectPost |
236 | dataBlob={dataBlob} | 236 | dataBlob={dataBlob} |
237 | onEndReached={this.onEndReached} | 237 | onEndReached={this.onEndReached} |
238 | endReached={item.commentReachEnd} | 238 | endReached={item.commentReachEnd} |
@@ -253,9 +253,8 @@ class SubjectPostContainer extends Component { | @@ -253,9 +253,8 @@ class SubjectPostContainer extends Component { | ||
253 | onPressShareGoods={this.onPressShareGoods} | 253 | onPressShareGoods={this.onPressShareGoods} |
254 | onPressLargeImage={this.onPressLargeImage} | 254 | onPressLargeImage={this.onPressLargeImage} |
255 | onPressDeleteComment={this.onPressDeleteComment} | 255 | onPressDeleteComment={this.onPressDeleteComment} |
256 | + isContentFetching={item.isContentFetching} | ||
256 | /> | 257 | /> |
257 | - } | ||
258 | - | ||
259 | </View> | 258 | </View> |
260 | ); | 259 | ); |
261 | } | 260 | } |
-
Please register or login to post a comment