From bc3e392a67f29423e9bfdaf9c8e2290b231618c7 Mon Sep 17 00:00:00 2001 From: xuwenyang Date: Sat, 27 Jul 2019 00:24:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug:=201.=20iphoneX=E9=94=AE?= =?UTF-8?q?=E7=9B=98=E9=81=AE=E6=8C=A1=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=202.=20ok=E7=BB=B7=E5=A4=A7=E4=BA=8E0=E6=97=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E5=AD=97=203.=20=E7=82=B9=E5=87=BB=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E5=BC=B9=E8=B5=B7=E8=BE=93=E5=85=A5=E9=94=AE=E7=9B=98?= =?UTF-8?q?=204.=20=E5=86=99=E6=97=A5=E8=AE=B0=E9=A1=B5=E9=9D=A2=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E5=A4=AA=E9=95=BF=E6=97=B6=E6=88=AA=E6=96=AD=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/comment/commentInput.js | 29 ++++++++++++++------------- src/component/diary/diaryIconOkB.js | 11 ++++++---- src/page/DiaryDetailPage.js | 2 +- src/page/WritePage.js | 7 ++++++- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/component/comment/commentInput.js b/src/component/comment/commentInput.js index 8081b47..61be81c 100644 --- a/src/component/comment/commentInput.js +++ b/src/component/comment/commentInput.js @@ -52,11 +52,11 @@ export default class CommentInput extends Component { content: content, replyUserId: comment.user.id, replyUserName: comment.user.name + }, () => { + if(this.refs.commentInput) { + this.refs.commentInput.focus(); + } }); - - if(this.refs.commentInput) { - // this.refs.commentInput.focus(); - } }); } @@ -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); }} /> ) : null} - { - !Api.IS_ANDROID - ? - : null - } - ); } @@ -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 }, diff --git a/src/component/diary/diaryIconOkB.js b/src/component/diary/diaryIconOkB.js index 4fc3c8e..7da0fd6 100644 --- a/src/component/diary/diaryIconOkB.js +++ b/src/component/diary/diaryIconOkB.js @@ -82,12 +82,12 @@ export default class DiaryIconOkB extends Component { style={localStyle.icon} /> - {this.state.count} + >{this.state.count > 0 ? this.state.count : ''} ); @@ -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 } }); diff --git a/src/page/DiaryDetailPage.js b/src/page/DiaryDetailPage.js index a426037..6b17b95 100644 --- a/src/page/DiaryDetailPage.js +++ b/src/page/DiaryDetailPage.js @@ -228,7 +228,7 @@ export default class DiaryDetailPage extends Component { } { - Api.IS_IOS ? : null + Api.IS_IOS ? : null } ); diff --git a/src/page/WritePage.js b/src/page/WritePage.js index 33543be..5eee7b6 100644 --- a/src/page/WritePage.js +++ b/src/page/WritePage.js @@ -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 ( - # {this.topic.title} + # {topicTitle} )