Authored by chenl

增加了首页数据判断和奥莱的下拉刷新。review by 孙凯。

... ... @@ -170,6 +170,12 @@ export default class Home extends Component {
}
_floorCellRender(rowData) {
if(!rowData || !rowData.get('data')){
return null;
}
let template_name = rowData.get('template_name');
switch (template_name) {
case 'focus': {
... ... @@ -509,7 +515,7 @@ export default class Home extends Component {
isOnPullToRefresh={isPullToRefresh}
refreshControl={
<RefreshControl
refreshing={false}
refreshing={isPullToRefresh}
onRefresh={() => {
this.props.onRefresh && this.props.onRefresh();
}}
... ...
... ... @@ -10,6 +10,7 @@ import {
Image,
ListView,
TouchableOpacity,
RefreshControl,
} from 'react-native';
import Immutable, {Map} from 'immutable';
import OutletSwiper from './OutletSwiper';
... ... @@ -148,7 +149,6 @@ export default class OutletPageListView extends Component {
}
render() {
let {
resource,
tabLabel,
... ... @@ -203,6 +203,8 @@ export default class OutletPageListView extends Component {
return (
<View style={styles.container}>
{
Platform.OS === 'ios' ?
<ListView
ref='OutletPageListView'
contentContainerStyle={styles.contentContainerStyle}
... ... @@ -224,6 +226,36 @@ export default class OutletPageListView extends Component {
}
}}
/>
:
<ListView
ref='OutletPageListView'
contentContainerStyle={styles.contentContainerStyle}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRowsAndSections(dataSource)}
renderRow={this.renderRow}
renderSectionHeader={this.renderSectionHeader}
enablePullToRefresh={true}
isOnPullToRefresh={isFetching}
refreshControl={
<RefreshControl
refreshing={isFetching}
onRefresh={() => {
this._onRefresh && this._onRefresh(true);
}}
colors={['#000000', '#ff0000']}
progressBackgroundColor="#ffffff"
/>
}
onEndReached={() => {
if (categoryNavigationList && productList && productList.size > 0) {
let {
resource,
} = this.props;
this.props.onEndReached && this.props.onEndReached(resource.get('content_code'),categoryNavigationList?categoryNavigationList[fliter].toJS():null);
}
}}
/>
}
{needShowToast ? <Prompt
text={showToastMessage}
duration={3000}
... ...