...
|
...
|
@@ -120,45 +120,45 @@ export default class SubjectPost extends Component { |
|
|
render() {
|
|
|
return(
|
|
|
<View style={styles.container}>
|
|
|
<Animated.View
|
|
|
style={[styles.contentInputContainer,{height:this.state.contentInputHeight}]}
|
|
|
>
|
|
|
<ListView
|
|
|
style={styles.container}
|
|
|
dataSource={this.dataSource.cloneWithRowsAndSections(this.props.dataBlob)}
|
|
|
renderRow={this.renderRow}
|
|
|
enableEmptySections={true}
|
|
|
onEndReached={() => {
|
|
|
this.props.onEndReached && this.props.onEndReached();
|
|
|
}}
|
|
|
renderFooter={()=>{
|
|
|
if (!this.props.dataBlob.comments.length) {
|
|
|
return <View style={styles.sofaContainer}>
|
|
|
<Image style={styles.sofaImage} source={require('../../images/posting/ic_null_message.png')}/>
|
|
|
<Text style={styles.sofaText}>快来抢沙发吧~</Text>
|
|
|
</View>
|
|
|
}
|
|
|
if (this.props.endReached) {
|
|
|
return <LoadMoreIndicator
|
|
|
isVisible={true}
|
|
|
text={'没有更多啦'}
|
|
|
/>
|
|
|
} else {
|
|
|
return <LoadMoreIndicator
|
|
|
isVisible={true}
|
|
|
animating={this.props.isFetching}
|
|
|
/>
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
{this.renderToolContainer(this.state.replyState)}
|
|
|
</Animated.View>
|
|
|
<AssertsPicker
|
|
|
style={[styles.boardSelectionContainer,{height:this.state.imageState,}]}
|
|
|
opacityToHide={this.state.imageState}
|
|
|
assets={this.props.assets}
|
|
|
assetsSelected={this.props.assetsSelected}
|
|
|
/>
|
|
|
<Animated.View
|
|
|
style={[styles.contentInputContainer,{height:this.state.contentInputHeight}]}
|
|
|
>
|
|
|
<ListView
|
|
|
style={styles.container}
|
|
|
dataSource={this.dataSource.cloneWithRowsAndSections(this.props.dataBlob)}
|
|
|
renderRow={this.renderRow}
|
|
|
enableEmptySections={true}
|
|
|
onEndReached={() => {
|
|
|
this.props.onEndReached && this.props.onEndReached();
|
|
|
}}
|
|
|
renderFooter={()=>{
|
|
|
if (!this.props.dataBlob.comments.length) {
|
|
|
return <View style={styles.sofaContainer}>
|
|
|
<Image style={styles.sofaImage} source={require('../../images/posting/ic_null_message.png')}/>
|
|
|
<Text style={styles.sofaText}>快来抢沙发吧~</Text>
|
|
|
</View>
|
|
|
}
|
|
|
if (this.props.endReached) {
|
|
|
return <LoadMoreIndicator
|
|
|
isVisible={true}
|
|
|
text={'没有更多啦'}
|
|
|
/>
|
|
|
} else {
|
|
|
return <LoadMoreIndicator
|
|
|
isVisible={true}
|
|
|
animating={this.props.isFetching}
|
|
|
/>
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
{this.renderToolContainer(this.state.replyState)}
|
|
|
</Animated.View>
|
|
|
{this.state.imageState == 0 ? null : <AssertsPicker
|
|
|
style={[styles.boardSelectionContainer,{height:this.state.imageState,}]}
|
|
|
opacityToHide={this.state.imageState}
|
|
|
assets={this.props.assets}
|
|
|
assetsSelected={this.props.assetsSelected}
|
|
|
/>}
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -220,6 +220,8 @@ export default class SubjectPost extends Component { |
|
|
</TouchableOpacity>
|
|
|
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -252,6 +254,8 @@ export default class SubjectPost extends Component { |
|
|
/>
|
|
|
<Text style={styles.submitText} onPress={this.commitComment}>发送</Text>
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -284,6 +288,8 @@ export default class SubjectPost extends Component { |
|
|
/>
|
|
|
<Text style={styles.submitText} onPress={this.commitComment}>发送</Text>
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -479,21 +485,6 @@ export default class SubjectPost extends Component { |
|
|
this.currentReplyState = ReplyState.replySomeone;
|
|
|
this.setState({replyState: this.currentReplyState});
|
|
|
}
|
|
|
|
|
|
renderLikeAvatar(avatars) {
|
|
|
if (avatars.length) {
|
|
|
return (
|
|
|
<View style={styles.avatarPannel}>
|
|
|
{avatars.map((item, i)=> {
|
|
|
let headURI = item.headIcon||'';
|
|
|
return (
|
|
|
<SlicedImage key={i} style={[styles.likeAvatar,{right:10*i}]} source={{uri:headURI}}/>
|
|
|
);
|
|
|
})}
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const styles = StyleSheet.create({
|
...
|
...
|
@@ -502,51 +493,6 @@ const styles = StyleSheet.create({ |
|
|
flex: 1,
|
|
|
backgroundColor: 'white',
|
|
|
},
|
|
|
likePannel: {
|
|
|
backgroundColor: 'white',
|
|
|
height: 50,
|
|
|
borderColor: '#a0a0a0',
|
|
|
borderTopWidth: 0.5,
|
|
|
borderBottomWidth: 0.5,
|
|
|
paddingLeft: 15,
|
|
|
paddingRight: 15,
|
|
|
flexDirection: 'row',
|
|
|
},
|
|
|
likeContainer: {
|
|
|
height:50,
|
|
|
flex: 1,
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
leftLikeContainer: {
|
|
|
height: 50,
|
|
|
flex: 1,
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
avatarPannel: {
|
|
|
flexDirection: 'row-reverse',
|
|
|
justifyContent: 'flex-end',
|
|
|
},
|
|
|
rightLikeContainer: {
|
|
|
flex: 1,
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'flex-end',
|
|
|
},
|
|
|
likeAvatar: {
|
|
|
width: 30,
|
|
|
height: 30,
|
|
|
borderRadius: 15,
|
|
|
},
|
|
|
likeText: {
|
|
|
fontSize: 14,
|
|
|
left: -10,
|
|
|
},
|
|
|
browseText: {
|
|
|
fontSize: 14,
|
|
|
paddingLeft: 15,
|
|
|
},
|
|
|
header: {
|
|
|
flexDirection: 'row',
|
|
|
paddingTop: 10,
|
...
|
...
|
@@ -592,14 +538,27 @@ const styles = StyleSheet.create({ |
|
|
toolContainer: {
|
|
|
flexDirection: 'row',
|
|
|
height: 41,
|
|
|
borderColor: '#a0a0a0',
|
|
|
borderBottomWidth:0.5,
|
|
|
borderTopWidth:0.5,
|
|
|
alignItems:'center',
|
|
|
backgroundColor: 'white',
|
|
|
paddingLeft: 15,
|
|
|
paddingRight: 15,
|
|
|
},
|
|
|
toolTopLine: {
|
|
|
position: 'absolute',
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
width: width,
|
|
|
height: 0.5,
|
|
|
backgroundColor: '#e0e0e0',
|
|
|
},
|
|
|
toolBottomLine: {
|
|
|
position: 'absolute',
|
|
|
left: 0,
|
|
|
bottom: 0,
|
|
|
width: width,
|
|
|
height: 0.5,
|
|
|
backgroundColor: '#e0e0e0',
|
|
|
},
|
|
|
imgIcon: {
|
|
|
left:0,
|
|
|
width:19,
|
...
|
...
|
|