...
|
...
|
@@ -33,6 +33,7 @@ export default class OutletPageListView extends Component { |
|
|
this.renderSectionHeader = this.renderSectionHeader.bind(this);
|
|
|
this.renderRow = this.renderRow.bind(this);
|
|
|
this._onRefresh = this._onRefresh.bind(this);
|
|
|
this.setActivityFliter = this.setActivityFliter.bind(this);
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
...
|
...
|
@@ -49,6 +50,14 @@ export default class OutletPageListView extends Component { |
|
|
this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'));
|
|
|
}
|
|
|
|
|
|
setActivityFliter() {
|
|
|
let {
|
|
|
resource,
|
|
|
} = this.props;
|
|
|
|
|
|
this.props.setActivityFliter && this.props.setActivityFliter(resource.get('content_code'),true);
|
|
|
}
|
|
|
|
|
|
renderSectionHeader(sectionData, sectionID) {
|
|
|
if (sectionID == 'categoryNavigationList') {
|
|
|
let {
|
...
|
...
|
@@ -89,6 +98,16 @@ export default class OutletPageListView extends Component { |
|
|
}
|
|
|
}else if (sectionID == 'activityList') {
|
|
|
return(<ActivityCell resource={rowData} onPressProduct={this.props.onPressProduct}/>);
|
|
|
}else if (sectionID == 'activityMore') {
|
|
|
if (rowData == 'more') {
|
|
|
return(
|
|
|
<TouchableOpacity activeOpacity={1} style={{width: width,height: 50,backgroundColor: 'red'}} onPress={() => {this.setActivityFliter && this.setActivityFliter();}}>
|
|
|
<View style={{width: width,height: 50,backgroundColor: 'red'}}>
|
|
|
<Text>more</Text>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
);
|
|
|
}
|
|
|
}else if (sectionID == 'categoryNavigationList') {
|
|
|
|
|
|
let paddingLeft = rowID % 2 == 1 ? rowMarginHorizontal / 2 : rowMarginHorizontal;
|
...
|
...
|
@@ -117,17 +136,23 @@ export default class OutletPageListView extends Component { |
|
|
|
|
|
let isFetching = resource.get('isFetching')?resource.get('isFetching'):false;
|
|
|
let honeResource = resource.get('honeResource');
|
|
|
let activityList = resource.get('activityList');
|
|
|
let activityList = resource.get('activityList')?resource.get('activityList').toArray():null;
|
|
|
let activityMore = resource.get('activityMore');
|
|
|
let categoryNavigationList = resource.get('categoryNavigationList')?resource.get('categoryNavigationList').toArray():null;
|
|
|
let productObj = categoryNavigationList?categoryNavigationList[0].get('list'):null;
|
|
|
let productList = productObj?productObj.get('product_list'):null;
|
|
|
let error = resource.get('error');
|
|
|
let ptr = resource.get('ptr')==true ? true : false;
|
|
|
let list = list = honeResource?honeResource.get('list'):null;
|
|
|
let activityListNum = activityList?activityList.length:0;
|
|
|
if (!activityMore) {
|
|
|
activityList = activityList?activityList.slice(0,10):null;
|
|
|
}
|
|
|
|
|
|
let dataSource = {
|
|
|
outletHomeReource: list?list.toArray():[],
|
|
|
activityList: activityList?activityList.toArray():[],
|
|
|
activityList: activityList?activityList:[],
|
|
|
activityMore: (!activityMore && activityListNum>10)?['more']:[],
|
|
|
categoryNavigationList: productList?productList.toArray():[],
|
|
|
};
|
|
|
|
...
|
...
|
|