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 { @@ -27,7 +27,7 @@ export default class CategoryList extends Component {
27 this.dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => !immutable.is(r1, r2)}); 27 this.dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => !immutable.is(r1, r2)});
28 this.subRenderRow = this.subRenderRow.bind(this); 28 this.subRenderRow = this.subRenderRow.bind(this);
29 this.state = { 29 this.state = {
30 - offsetx: 0, 30 + offsetx: -width/2,
31 }; 31 };
32 this.cacheChannel=''; 32 this.cacheChannel='';
33 } 33 }
@@ -38,7 +38,7 @@ export default class CategoryList extends Component { @@ -38,7 +38,7 @@ export default class CategoryList extends Component {
38 38
39 componentWillUpdate(nextProps,nextState){ 39 componentWillUpdate(nextProps,nextState){
40 if(this.cacheChannel!=nextProps.currentChannelId){ 40 if(this.cacheChannel!=nextProps.currentChannelId){
41 - this.setState({offsetx:0}); 41 + this.setState({offsetx:-width/2});
42 this.refs.categoryList && this.refs.categoryList.scrollTo({x: 0, y: 0, animated: false}); 42 this.refs.categoryList && this.refs.categoryList.scrollTo({x: 0, y: 0, animated: false});
43 this.cacheChannel=nextProps.currentChannelId; 43 this.cacheChannel=nextProps.currentChannelId;
44 } 44 }
@@ -53,7 +53,7 @@ export default class CategoryList extends Component { @@ -53,7 +53,7 @@ export default class CategoryList extends Component {
53 if(rowID==this.props.currentCateId){ 53 if(rowID==this.props.currentCateId){
54 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); 54 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
55 if(this.state.offsetx<0){ 55 if(this.state.offsetx<0){
56 - this.setState({offsetx:0}); 56 + this.setState({offsetx:-width/2});
57 }else{ 57 }else{
58 this.setState({offsetx: -width/2}); 58 this.setState({offsetx: -width/2});
59 } 59 }
@@ -157,19 +157,19 @@ let styles = StyleSheet.create({ @@ -157,19 +157,19 @@ let styles = StyleSheet.create({
157 flex: 1, 157 flex: 1,
158 flexDirection: 'row', 158 flexDirection: 'row',
159 width: width, 159 width: width,
160 - height: height - 156, 160 + height: height - 106,
161 backgroundColor: 'white', 161 backgroundColor: 'white',
162 }, 162 },
163 contentContainer: { 163 contentContainer: {
164 backgroundColor: 'white', 164 backgroundColor: 'white',
165 width: width, 165 width: width,
166 - height: height - 156, 166 + height: height - 106,
167 }, 167 },
168 subContentContainer: { 168 subContentContainer: {
169 // position: 'absolute', 169 // position: 'absolute',
170 backgroundColor: '#f4f4f4', 170 backgroundColor: '#f4f4f4',
171 width: width/2, 171 width: width/2,
172 - height: height - 156, 172 + height: height - 106,
173 173
174 }, 174 },
175 row: { 175 row: {
@@ -9,6 +9,7 @@ import ReactNative, { @@ -9,6 +9,7 @@ import ReactNative, {
9 PixelRatio, 9 PixelRatio,
10 TouchableOpacity, 10 TouchableOpacity,
11 Platform, 11 Platform,
  12 + DeviceInfo,
12 } from 'react-native'; 13 } from 'react-native';
13 14
14 import Immutable, {Map} from 'immutable'; 15 import Immutable, {Map} from 'immutable';
@@ -69,7 +69,7 @@ export function getCategory() { @@ -69,7 +69,7 @@ export function getCategory() {
69 return (dispatch, getState) => { 69 return (dispatch, getState) => {
70 let {app, outlet} = getState(); 70 let {app, outlet} = getState();
71 let parent_id = app.categoryId; 71 let parent_id = app.categoryId;
72 - let channel = outlet.channel; 72 + let channel = app.channel;
73 dispatch(getCategoryRequest()); 73 dispatch(getCategoryRequest());
74 return new OutletService(app.serviceHost).getCategory(parent_id) 74 return new OutletService(app.serviceHost).getCategory(parent_id)
75 .then(json => { 75 .then(json => {