Authored by 于良

Merge branch '5.4.1' of http://git.yoho.cn/mobile/YH_RNComponent into 5.4.1

... ... @@ -27,7 +27,7 @@ export default class CategoryList extends Component {
this.dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => !immutable.is(r1, r2)});
this.subRenderRow = this.subRenderRow.bind(this);
this.state = {
offsetx: 0,
offsetx: -width/2,
};
this.cacheChannel='';
}
... ... @@ -38,7 +38,7 @@ export default class CategoryList extends Component {
componentWillUpdate(nextProps,nextState){
if(this.cacheChannel!=nextProps.currentChannelId){
this.setState({offsetx:0});
this.setState({offsetx:-width/2});
this.refs.categoryList && this.refs.categoryList.scrollTo({x: 0, y: 0, animated: false});
this.cacheChannel=nextProps.currentChannelId;
}
... ... @@ -53,7 +53,7 @@ export default class CategoryList extends Component {
if(rowID==this.props.currentCateId){
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
if(this.state.offsetx<0){
this.setState({offsetx:0});
this.setState({offsetx:-width/2});
}else{
this.setState({offsetx: -width/2});
}
... ... @@ -157,19 +157,19 @@ let styles = StyleSheet.create({
flex: 1,
flexDirection: 'row',
width: width,
height: height - 156,
height: height - 106,
backgroundColor: 'white',
},
contentContainer: {
backgroundColor: 'white',
width: width,
height: height - 156,
height: height - 106,
},
subContentContainer: {
// position: 'absolute',
backgroundColor: '#f4f4f4',
width: width/2,
height: height - 156,
height: height - 106,
},
row: {
... ...
... ... @@ -9,6 +9,7 @@ import ReactNative, {
PixelRatio,
TouchableOpacity,
Platform,
DeviceInfo,
} from 'react-native';
import Immutable, {Map} from 'immutable';
... ...
... ... @@ -69,7 +69,7 @@ export function getCategory() {
return (dispatch, getState) => {
let {app, outlet} = getState();
let parent_id = app.categoryId;
let channel = outlet.channel;
let channel = app.channel;
dispatch(getCategoryRequest());
return new OutletService(app.serviceHost).getCategory(parent_id)
.then(json => {
... ...