...
|
...
|
@@ -18,43 +18,11 @@ import SlicedImage from '../../../common/components/SlicedImage'; |
|
|
export default class SubjectPost extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.renderReplyContentWithPlaceholder = this.renderReplyContentWithPlaceholder.bind(this);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
switch (this.props.replyState) {
|
|
|
case 0: {//none...
|
|
|
if (this.props.likeState == 'Y') {
|
|
|
iconSouce=require('../../images/home/like.png');
|
|
|
} else if (this.props.likeState == 'N'){
|
|
|
iconSouce=require('../../images/home/unlike.png');
|
|
|
}
|
|
|
return (
|
|
|
<View style={styles.toolContainer}>
|
|
|
<SlicedImage style={styles.imgIcon} source={this.props.iconSouce}/>
|
|
|
<TouchableOpacity style={styles.imgButton} onPress={this.props.onPressLikeOrDislike}>
|
|
|
</TouchableOpacity>
|
|
|
<View style={styles.rightContainer}>
|
|
|
<TouchableOpacity
|
|
|
style={styles.lzContainer}
|
|
|
onPress={
|
|
|
()=> {
|
|
|
this.props.onPressLZContainer&&this.props.onPressLZContainer()
|
|
|
}
|
|
|
}
|
|
|
>
|
|
|
<Text style={styles.fakePlaceHolder}>回复楼主:</Text>
|
|
|
<Text style={styles.replyCountText}>{'已有'+this.props.commentCount+'条回复'}</Text>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
break;
|
|
|
case 1: {// 楼主
|
|
|
return (
|
|
|
renderReplyContentWithPlaceholder(placeholder) {
|
|
|
return(
|
|
|
<View style={styles.toolContainer}>
|
|
|
<SlicedImage style={styles.imgIcon} source={this.props.iconSouce}/>
|
|
|
<TouchableOpacity style={styles.imgButton} onPress={this.props.showImagePannel}>
|
...
|
...
|
@@ -68,7 +36,7 @@ export default class SubjectPost extends Component { |
|
|
ref='textInput'
|
|
|
style={styles.replyTextInput}
|
|
|
placeholderTextColor='#b0b0b0'
|
|
|
placeholder='回复楼主'
|
|
|
placeholder={placeholder}
|
|
|
multiline={true}
|
|
|
autoCapitalize={'none'}
|
|
|
autoCorrect={false}
|
...
|
...
|
@@ -93,41 +61,33 @@ export default class SubjectPost extends Component { |
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
break;
|
|
|
case 2: {// others...
|
|
|
|
|
|
render() {
|
|
|
switch (this.props.replyState) {
|
|
|
case 0: {//none...
|
|
|
if (this.props.likeState == 'Y') {
|
|
|
iconSouce=require('../../images/home/like.png');
|
|
|
} else if (this.props.likeState == 'N'){
|
|
|
iconSouce=require('../../images/home/unlike.png');
|
|
|
}
|
|
|
return (
|
|
|
<View style={styles.toolContainer}>
|
|
|
<SlicedImage style={styles.imgIcon} source={this.props.iconSouce}/>
|
|
|
<TouchableOpacity style={styles.imgButton} onPress={this.props.showImagePannel}>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity style={styles.keyboardIcon} onPress={this.props.blurAll}>
|
|
|
<SlicedImage source={require('../../images/posting/jianpan1.png')} />
|
|
|
<TouchableOpacity style={styles.imgButton} onPress={this.props.onPressLikeOrDislike}>
|
|
|
</TouchableOpacity>
|
|
|
<View style={[styles.rightContainer]}>
|
|
|
<TextInput
|
|
|
ref='textInput'
|
|
|
style={styles.replyTextInput}
|
|
|
placeholderTextColor='#b0b0b0'
|
|
|
placeholder={'回复'+this.someOneToReply+':'}
|
|
|
multiline={true}
|
|
|
autoCapitalize={'none'}
|
|
|
selectionColor={'black'}
|
|
|
autoCorrect={false}
|
|
|
autoFocus={true}
|
|
|
maxLength={1000}
|
|
|
onChangeText={
|
|
|
(text)=>{
|
|
|
this.props.onReplyTextChange&&this.props.onReplyTextChange(text);
|
|
|
}
|
|
|
<View style={styles.rightContainer}>
|
|
|
<TouchableOpacity
|
|
|
style={styles.lzContainer}
|
|
|
onPress={
|
|
|
()=> {
|
|
|
this.props.onPressLZContainer&&this.props.onPressLZContainer()
|
|
|
}
|
|
|
onKeyPress={(event)=>{
|
|
|
if (this.replyContent >= 1000) {
|
|
|
NativeModules.YH_CommunityHelper.showText('超出1000字符最长限制');
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
<Text style={[styles.submitText, {color:this.props.replyTextColor}]} onPress={this.props.commitComment}>发送</Text>
|
|
|
>
|
|
|
<Text style={styles.fakePlaceHolder}>回复楼主:</Text>
|
|
|
<Text style={styles.replyCountText}>{'已有'+this.props.commentCount+'条回复'}</Text>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
...
|
...
|
@@ -135,6 +95,23 @@ export default class SubjectPost extends Component { |
|
|
);
|
|
|
}
|
|
|
break;
|
|
|
case 1: {// 楼主
|
|
|
return (
|
|
|
<View >
|
|
|
{this.renderReplyContentWithPlaceholder('回复楼主:')}
|
|
|
</View>
|
|
|
)
|
|
|
}
|
|
|
break;
|
|
|
case 2: {// others...
|
|
|
return (
|
|
|
<View>
|
|
|
{this.renderReplyContentWithPlaceholder('回复'+this.someOneToReply+':')}
|
|
|
</View>
|
|
|
)
|
|
|
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
...
|
...
|
|