...
|
...
|
@@ -18,6 +18,48 @@ import SlicedImage from '../../../common/components/SlicedImage'; |
|
|
export default class SubjectPost extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.renderReplyContentWithPlaceholder = this.renderReplyContentWithPlaceholder.bind(this);
|
|
|
}
|
|
|
|
|
|
renderReplyContentWithPlaceholder(placeholder) {
|
|
|
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>
|
|
|
<View style={[styles.rightContainer]}>
|
|
|
<TextInput
|
|
|
ref='textInput'
|
|
|
style={styles.replyTextInput}
|
|
|
placeholderTextColor='#b0b0b0'
|
|
|
placeholder={placeholder}
|
|
|
multiline={true}
|
|
|
autoCapitalize={'none'}
|
|
|
autoCorrect={false}
|
|
|
selectionColor={'black'}
|
|
|
autoFocus={true}
|
|
|
maxLength={1000}
|
|
|
onChangeText={
|
|
|
(text)=>{
|
|
|
this.props.onReplyTextChange&&this.props.onReplyTextChange(text);
|
|
|
}
|
|
|
}
|
|
|
onKeyPress={(event)=>{
|
|
|
if (this.props.replyContent >= 1000) {
|
|
|
NativeModules.YH_CommunityHelper.showText('超出1000字符最长限制');
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
<Text style={[styles.submitText, {color:this.props.replyTextColor}]} onPress={this.props.commitComment}>发送</Text>
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
render() {
|
...
|
...
|
@@ -55,84 +97,19 @@ export default class SubjectPost extends Component { |
|
|
break;
|
|
|
case 1: {// 楼主
|
|
|
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>
|
|
|
<View style={[styles.rightContainer]}>
|
|
|
<TextInput
|
|
|
ref='textInput'
|
|
|
style={styles.replyTextInput}
|
|
|
placeholderTextColor='#b0b0b0'
|
|
|
placeholder='回复楼主'
|
|
|
multiline={true}
|
|
|
autoCapitalize={'none'}
|
|
|
autoCorrect={false}
|
|
|
selectionColor={'black'}
|
|
|
autoFocus={true}
|
|
|
maxLength={1000}
|
|
|
onChangeText={
|
|
|
(text)=>{
|
|
|
this.props.onReplyTextChange&&this.props.onReplyTextChange(text);
|
|
|
}
|
|
|
}
|
|
|
onKeyPress={(event)=>{
|
|
|
if (this.props.replyContent >= 1000) {
|
|
|
NativeModules.YH_CommunityHelper.showText('超出1000字符最长限制');
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
<Text style={[styles.submitText, {color:this.props.replyTextColor}]} onPress={this.props.commitComment}>发送</Text>
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
<View >
|
|
|
{this.renderReplyContentWithPlaceholder('回复楼主:')}
|
|
|
</View>
|
|
|
);
|
|
|
)
|
|
|
}
|
|
|
break;
|
|
|
case 2: {// others...
|
|
|
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>
|
|
|
<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);
|
|
|
}
|
|
|
}
|
|
|
onKeyPress={(event)=>{
|
|
|
if (this.replyContent >= 1000) {
|
|
|
NativeModules.YH_CommunityHelper.showText('超出1000字符最长限制');
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
<Text style={[styles.submitText, {color:this.props.replyTextColor}]} onPress={this.props.commitComment}>发送</Text>
|
|
|
</View>
|
|
|
<View style={styles.toolTopLine}/>
|
|
|
<View style={styles.toolBottomLine}/>
|
|
|
<View>
|
|
|
{this.renderReplyContentWithPlaceholder('回复'+this.someOneToReply+':')}
|
|
|
</View>
|
|
|
);
|
|
|
)
|
|
|
|
|
|
}
|
|
|
break;
|
|
|
default:
|
...
|
...
|
|