Authored by 盖剑秋

Fix bug YH-2947. reviewed by redding.

@@ -26,7 +26,7 @@ import SectionSelector from './SectionSelector'; @@ -26,7 +26,7 @@ import SectionSelector from './SectionSelector';
26 26
27 let dismissKeyboard = require('dismissKeyboard'); 27 let dismissKeyboard = require('dismissKeyboard');
28 let YH_CommunityAssetsPicker = NativeModules.YH_CommunityAssetsPicker; 28 let YH_CommunityAssetsPicker = NativeModules.YH_CommunityAssetsPicker;
29 - 29 +let YH_CommunityHelper = NativeModules.YH_CommunityHelper;
30 30
31 let {width, height} = Dimensions.get('window'); 31 let {width, height} = Dimensions.get('window');
32 let navbarHeight = (Platform.OS === 'android') ? 50 : 64; 32 let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
@@ -158,7 +158,7 @@ export default class Posting extends Component { @@ -158,7 +158,7 @@ export default class Posting extends Component {
158 }} 158 }}
159 onKeyPress={(event) => { 159 onKeyPress={(event) => {
160 if (this.titleLength >= 30) { 160 if (this.titleLength >= 30) {
161 - Alert.alert('抱歉','超出30字符最长限制'); 161 + YH_CommunityHelper.showText('超出30字符最长限制');
162 } 162 }
163 }} 163 }}
164 value={this.props.titleValue} 164 value={this.props.titleValue}
@@ -187,7 +187,7 @@ export default class Posting extends Component { @@ -187,7 +187,7 @@ export default class Posting extends Component {
187 }} 187 }}
188 onKeyPress={(event) => { 188 onKeyPress={(event) => {
189 if (this.contentLength >= 2000) { 189 if (this.contentLength >= 2000) {
190 - Alert.alert('抱歉','超出2000字符最长限制'); 190 + YH_CommunityHelper.showText('超出2000字符最长限制');
191 } 191 }
192 }} 192 }}
193 value={this.props.contentValue} 193 value={this.props.contentValue}
@@ -86,6 +86,7 @@ export default class SubjectPost extends Component { @@ -86,6 +86,7 @@ export default class SubjectPost extends Component {
86 } 86 }
87 let kbdHeight = height - event.endCoordinates.screenY; 87 let kbdHeight = height - event.endCoordinates.screenY;
88 if (kbdHeight == 0) { 88 if (kbdHeight == 0) {
  89 + this.currentReplyState = ReplyState.replyLZ;
89 this.setState({replyState: ReplyState.replyNone}); 90 this.setState({replyState: ReplyState.replyNone});
90 } 91 }
91 this.boardHeight = kbdHeight>0?kbdHeight:250; 92 this.boardHeight = kbdHeight>0?kbdHeight:250;
@@ -140,7 +140,7 @@ class SubjectPostContainer extends Component { @@ -140,7 +140,7 @@ class SubjectPostContainer extends Component {
140 } 140 }
141 console.log(newFakeComment); 141 console.log(newFakeComment);
142 let currentCommentList = item.commentList.toJS(); 142 let currentCommentList = item.commentList.toJS();
143 - let newList = [newFakeComment,...currentCommentList]; 143 + let newList = [...currentCommentList,newFakeComment];
144 params.forumCode = item.forumCode; 144 params.forumCode = item.forumCode;
145 this.props.actions.commentWithParams(this.sid,params,newList); 145 this.props.actions.commentWithParams(this.sid,params,newList);
146 } 146 }
@@ -458,7 +458,8 @@ export function commitComment(sid,params, newList) { @@ -458,7 +458,8 @@ export function commitComment(sid,params, newList) {
458 new PostingService().commitReply(params) 458 new PostingService().commitReply(params)
459 .then(response => { 459 .then(response => {
460 Alert.alert('提示','回复成功'); 460 Alert.alert('提示','回复成功');
461 - newList[0].commentId = response.id; 461 + let maxLength = newList.length-1;
  462 + newList[maxLength].commentId = response.id;
462 dispatch(commentSuccess(sid,response, newList)); 463 dispatch(commentSuccess(sid,response, newList));
463 }).catch(error => { 464 }).catch(error => {
464 Alert.alert('提示','回复失败'); 465 Alert.alert('提示','回复失败');