Authored by 盖剑秋

Fix bug YH-2947. reviewed by redding.

... ... @@ -26,7 +26,7 @@ import SectionSelector from './SectionSelector';
let dismissKeyboard = require('dismissKeyboard');
let YH_CommunityAssetsPicker = NativeModules.YH_CommunityAssetsPicker;
let YH_CommunityHelper = NativeModules.YH_CommunityHelper;
let {width, height} = Dimensions.get('window');
let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
... ... @@ -158,7 +158,7 @@ export default class Posting extends Component {
}}
onKeyPress={(event) => {
if (this.titleLength >= 30) {
Alert.alert('抱歉','超出30字符最长限制');
YH_CommunityHelper.showText('超出30字符最长限制');
}
}}
value={this.props.titleValue}
... ... @@ -187,7 +187,7 @@ export default class Posting extends Component {
}}
onKeyPress={(event) => {
if (this.contentLength >= 2000) {
Alert.alert('抱歉','超出2000字符最长限制');
YH_CommunityHelper.showText('超出2000字符最长限制');
}
}}
value={this.props.contentValue}
... ...
... ... @@ -86,6 +86,7 @@ export default class SubjectPost extends Component {
}
let kbdHeight = height - event.endCoordinates.screenY;
if (kbdHeight == 0) {
this.currentReplyState = ReplyState.replyLZ;
this.setState({replyState: ReplyState.replyNone});
}
this.boardHeight = kbdHeight>0?kbdHeight:250;
... ...
... ... @@ -140,7 +140,7 @@ class SubjectPostContainer extends Component {
}
console.log(newFakeComment);
let currentCommentList = item.commentList.toJS();
let newList = [newFakeComment,...currentCommentList];
let newList = [...currentCommentList,newFakeComment];
params.forumCode = item.forumCode;
this.props.actions.commentWithParams(this.sid,params,newList);
}
... ...
... ... @@ -458,7 +458,8 @@ export function commitComment(sid,params, newList) {
new PostingService().commitReply(params)
.then(response => {
Alert.alert('提示','回复成功');
newList[0].commentId = response.id;
let maxLength = newList.length-1;
newList[maxLength].commentId = response.id;
dispatch(commentSuccess(sid,response, newList));
}).catch(error => {
Alert.alert('提示','回复失败');
... ...