Authored by 盖剑秋

通过sid取section。reviewed by 于良。

... ... @@ -320,18 +320,6 @@ export default function community(platform) {
state.dispatch(startEditPost(state.getPostingState()));
},
pushPostingWithUID(uid) {
new PostingService().getPostUser(uid).then(json => {
if (json.forbidSpeaking === 'Y') {
Alert.alert('抱歉','您暂时被禁言,请等待禁言解除哦~');
} else {
Actions.Posting();
}
}).catch(error => {
Actions.Posting();
});
},
/*
* 自定义导航push动画
*
... ...
... ... @@ -64,14 +64,16 @@ class PostingContainer extends Component{
}
componentDidMount() {
if (this.props.section.name.length && this.props.section.id>0) {
this.boardSelectedWithName(this.props.section.name,this.props.section.id);
}else {
if (this.props.section.sid>-1) {
let section = this.props.section.items.get(this.sid);
this.boardSelectedWithName(section.name,section.id);
} else {
InteractionManager.runAfterInteractions(() => {
this._onGetBordList();
});
}
if (shouldHideTabBar(this.props.navigationState)) {
NativeModules.YH_CommunityHelper.hideTabBar();
}
... ... @@ -120,6 +122,11 @@ class PostingContainer extends Component{
this.props.actions.contentEdited (content);
}
render() {
let fromSection=false;
if (this.props.section.sid>-1) {
let section = this.props.section.items.get(this.sid);
fromSection = section.name.length && section.id>0;
}
return(
<View style={styles.container}>
<Posting
... ... @@ -132,7 +139,7 @@ class PostingContainer extends Component{
contentEdited={this.contentEdited}
titleValue={this.props.posting.title}
contentValue={this.props.posting.content}
fromSection={this.props.section.name.length && this.props.section.id>0}
fromSection={fromSection}
/>
</View>
);
... ...
... ... @@ -70,9 +70,13 @@ function drillToEditPostPage(uid,postingPageFunc) {
if (json.forbidSpeaking === 'Y') {
Alert.alert('抱歉','您暂时被禁言,请等待禁言解除哦~');
} else {
console.log('yyyyyyyyyyyyyyyyyyy');
Actions.Posting();
}
}).catch(error => {
console.log('eeeeeeeeeeeeeee');
console.log(error);
Actions.Posting();
})
}
... ...