修复bug:

1. iphoneX键盘遮挡问题修复
2. ok绷大于0时显示数字
3. 点击回复弹起输入键盘
4. 写日记页面话题太长时截断显示
This commit is contained in:
xuwenyang 2019-07-27 00:24:04 +08:00
parent ffc12f3e74
commit bc3e392a67
4 changed files with 29 additions and 20 deletions

View file

@ -52,12 +52,12 @@ export default class CommentInput extends Component {
content: content,
replyUserId: comment.user.id,
replyUserName: comment.user.name
});
}, () => {
if(this.refs.commentInput) {
// this.refs.commentInput.focus();
this.refs.commentInput.focus();
}
});
});
}
componentWillUnmount(){
@ -125,9 +125,16 @@ export default class CommentInput extends Component {
underlineColorAndroid="transparent"
onChangeText={(text) => {
this.setState({
let state = {
content: text
})
}
if(!text || !text.startsWith('@'+this.state.replyUserName)) {
state.replyUserId = 0;
state.replyUserName = '';
}
this.setState(state);
}}
/>
<TouchableOpacity style={localStyle.buttonWrap}
@ -145,12 +152,6 @@ export default class CommentInput extends Component {
</View>
) : null}
{
!Api.IS_ANDROID
? <KeyboardSpacer topSpacing={Api.IS_IPHONEX ? -30 : 0} />
: null
}
</View>
);
}
@ -158,7 +159,7 @@ export default class CommentInput extends Component {
const localStyle = StyleSheet.create({
container: {
height: 56,
height: Api.IS_IPHONEX ? 66 : 56,
backgroundColor: '#eee',
elevation: 3,
borderColor: '#bbb',
@ -182,7 +183,7 @@ const localStyle = StyleSheet.create({
position: 'absolute',
bottom: 0,
right: 0,
paddingBottom: 12,
paddingBottom: Api.IS_IPHONEX ? 22 : 12,
paddingRight:12,
paddingTop: 12
},

View file

@ -82,12 +82,12 @@ export default class DiaryIconOkB extends Component {
style={localStyle.icon}
/>
<Text style={[localStyle.icon, {
<Text style={[localStyle.text, {
color: !this.state.active
? Color.inactiveText
: Color.primary
}]}
>{this.state.count}</Text>
>{this.state.count > 0 ? this.state.count : ''}</Text>
</View>
</TouchableOpacity>
);
@ -96,7 +96,9 @@ export default class DiaryIconOkB extends Component {
const localStyle = StyleSheet.create({
wrap: {
flexDirection: 'row'
flexDirection: 'row',
marginRight: 10,
marginTop: -1
},
icon: {
width: 18,
@ -105,6 +107,7 @@ const localStyle = StyleSheet.create({
marginRight: 1
},
text: {
fontSize: 15
fontSize: 15,
marginLeft: 4
}
});

View file

@ -228,7 +228,7 @@ export default class DiaryDetailPage extends Component {
}
{
Api.IS_IOS ? <KeyboardSpacer topSpacing={Api.IS_IPHONEX ? -30 : 0} /> : null
Api.IS_IOS ? <KeyboardSpacer topSpacing={Api.IS_IPHONEX ? -10 : 0} /> : null
}
</View>
);

View file

@ -361,10 +361,15 @@ export default class WritePage extends Component {
return null;
}
let topicTitle = this.topic.title;
if(topicTitle && topicTitle.length > 6) {
topicTitle = topicTitle.substring(0, 6) + '..';
}
return (
<TouchableOpacity>
<Text style={{color: Color.light, fontSize: 15, paddingRight: 15}}>
# {this.topic.title}
# {topicTitle}
</Text>
</TouchableOpacity>
)