Authored by 盖剑秋

Fix bugs of 7.18, reviewed by redding.

... ... @@ -12,6 +12,7 @@ import ReactNative, {
Image,
Alert,
Animated,
Keyboard,
} from 'react-native';
import {
... ... @@ -228,6 +229,11 @@ export default function community(platform) {
}
}}
rightButtonTextStyle={[styles.barRightButtonText,{color:store.getState().posting.dataValid?'white':'#a0a0a0'}]}
onBack={()=>{
let dismissKeyboard = require('dismissKeyboard');
dismissKeyboard();
Actions.pop();
}}
/>
</Scene>
... ... @@ -296,8 +302,7 @@ export default function community(platform) {
},
homeOnRight(state) {
Actions.SubjectPost();
// state.dispatch(startEditPost(state.getPostingState()));
state.dispatch(startEditPost(state.getPostingState()));
},
/*
* 自定义导航push动画
... ...
... ... @@ -17,6 +17,7 @@ import {
Easing,
ScrollView,
NativeModules,
Alert,
} from 'react-native'
import AssertsPicker from './AssertsPicker';
... ... @@ -79,6 +80,9 @@ export default class Posting extends Component {
}
showBoardPannel() {
if (this.props.fromSection) {
return;
}
this.boardInView= true;
this.setState({boardState:this.boardSelectionHeight,imageState:0});
... ... @@ -147,6 +151,8 @@ export default class Posting extends Component {
maxLength={30}
numberOfLines={1}
autoFocus={true}
autoCapitalize={'none'}
autoCorrect={false}
onChangeText={
(text)=>{
this.titleLength = text.length;
... ... @@ -155,7 +161,9 @@ export default class Posting extends Component {
}
onKeyPress={
(event)=>{
if (this.titleLength>=30) {
Alert.alert('抱歉','超出30字符最长限制');
console.log('满了');
}
}
... ... @@ -177,9 +185,11 @@ export default class Posting extends Component {
this.props.contentEdited(text);
}
}
onKeyPress={
(event)=>{
if (this.contentLength>=2000) {
Alert.alert('抱歉','超出2000字符最长限制');
console.log('满了');
}
}
... ... @@ -215,10 +225,11 @@ export default class Posting extends Component {
<View style={[styles.boardSelectionContainer,{height:this.state.boardState,}]} opacity={this.state.boardState}>
<View style={styles.boardSelectionScroll}>
{this.props.boards.map((item,i)=>{
let bgColor = item.forumName === this.props.selectedBoard?'#cccccc':'white'
return(
<Text
key={i}
style={styles.boardSelectionItem}
style={[styles.boardSelectionItem,{backgroundColor: bgColor}]}
onPress={event=>{
this.props.onBoardPress(item.forumName,item.forumCode);
// this.blurAll();
... ... @@ -249,7 +260,7 @@ const styles = StyleSheet.create({
left: 0,
top:0,
height:44,
padding:15,
padding:14,
color: 'black',
fontSize: 15,
},
... ...
... ... @@ -64,13 +64,19 @@ 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 {
InteractionManager.runAfterInteractions(() => {
this._onGetBordList();
});
}
if (shouldHideTabBar(this.props.navigationState)) {
NativeModules.YH_CommunityHelper.hideTabBar();
}
InteractionManager.runAfterInteractions(() => {
this._onGetBordList();
});
}
_onGetBordList() {
... ... @@ -128,6 +134,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}
/>
</View>
);
... ...