...
|
...
|
@@ -54,6 +54,8 @@ export default class NewArrival extends React.PureComponent { |
|
|
let {topPart} = this.props;
|
|
|
let banner = topPart.get('topList', List());
|
|
|
let recommend = topPart.get('brandList', List());
|
|
|
let feature = topPart.get('featuredList', List());
|
|
|
|
|
|
let containerHeight = 0;
|
|
|
if (banner && banner.size > 0) {
|
|
|
containerHeight = containerHeight + 132;
|
...
|
...
|
@@ -61,12 +63,27 @@ export default class NewArrival extends React.PureComponent { |
|
|
if (recommend && recommend.size > 0) {
|
|
|
containerHeight = containerHeight + 180;
|
|
|
}
|
|
|
if (feature && feature.size > 0) {
|
|
|
let realHeight11 = 0;
|
|
|
if (feature.size = 1) {
|
|
|
realHeight11 = Platform.OS === 'ios'? featuredHight + 50 : featuredHight + 65;
|
|
|
}
|
|
|
|
|
|
if (feature.size = 2) {
|
|
|
realHeight11 = Platform.OS === 'ios'? (((width-48) / 2)*220)/330+58 : (((width-48) / 2)*220)/330+64;
|
|
|
}
|
|
|
|
|
|
if (feature.size > 2) {
|
|
|
realHeight11 = 181;
|
|
|
}
|
|
|
containerHeight = containerHeight + Math.ceil(realHeight11);
|
|
|
}
|
|
|
|
|
|
if(value === 'filter'){
|
|
|
this.sectionList && this.sectionList.scrollToLocation({itemIndex: 0, viewOffset: containerHeight - 10, animated: false});
|
|
|
// this.sectionList && this.sectionList.scrollToLocation({itemIndex: 0,sectionIndex: 0, viewOffset: 20 + containerHeight,viewPosition: 1, animated: false});
|
|
|
}
|
|
|
if(value==='default'){
|
|
|
this.sectionList && this.sectionList.scrollToLocation({itemIndex: 0, viewOffset: containerHeight - 10, animated: false});
|
|
|
this.sectionList && this.sectionList.scrollToLocation({itemIndex: 0,sectionIndex: 0, viewOffset: realHeight, animated: false});
|
|
|
}
|
|
|
this.props.onPressProductFilter && this.props.onPressProductFilter(value);
|
|
|
|
...
|
...
|
@@ -174,6 +191,8 @@ export default class NewArrival extends React.PureComponent { |
|
|
|
|
|
let banner = topPart.get('topList', List());
|
|
|
let recommend = topPart.get('brandList', List());
|
|
|
let feature = topPart.get('featuredList', List());
|
|
|
|
|
|
let containerHeight = 0;
|
|
|
if (banner && banner.size > 0) {
|
|
|
containerHeight = containerHeight + 132;
|
...
|
...
|
@@ -181,7 +200,21 @@ export default class NewArrival extends React.PureComponent { |
|
|
if (recommend && recommend.size > 0) {
|
|
|
containerHeight = containerHeight + 180;
|
|
|
}
|
|
|
if (feature && feature.size > 0) {
|
|
|
let realHeight11 = 0;
|
|
|
if (feature.size = 1) {
|
|
|
realHeight11 = Platform.OS === 'ios'? featuredHight + 50 : featuredHight + 65;
|
|
|
}
|
|
|
|
|
|
if (feature.size = 2) {
|
|
|
realHeight11 = Platform.OS === 'ios'? (((width-48) / 2)*220)/330+58 : (((width-48) / 2)*220)/330+64;
|
|
|
}
|
|
|
|
|
|
if (feature.size > 2) {
|
|
|
realHeight11 = 181;
|
|
|
}
|
|
|
containerHeight = containerHeight + Math.ceil(realHeight11);
|
|
|
}
|
|
|
let dataSource = [];
|
|
|
let dataSize = latest.length / 2;
|
|
|
for(let i = 0; i < dataSize; i ++) {
|
...
|
...
|
@@ -229,7 +262,7 @@ export default class NewArrival extends React.PureComponent { |
|
|
}
|
|
|
}}
|
|
|
getItemLayout={(data, index) => (
|
|
|
{length: realHeight, offset: realHeight * index, index}
|
|
|
{length: realHeight, offset: realHeight * index + containerHeight, index}
|
|
|
)}
|
|
|
sections={[{data: dataSource, key: 'latest'}]}
|
|
|
viewabilityConfig={VIEWABILITY_CONFIG}
|
...
|
...
|
@@ -248,7 +281,7 @@ export default class NewArrival extends React.PureComponent { |
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
|
|
|
|
|
|
{productList.isFilter ?
|
|
|
<NewArrivalCategoryList
|
|
|
productList={productList}
|
...
|
...
|
@@ -263,7 +296,7 @@ export default class NewArrival extends React.PureComponent { |
|
|
onPressProductFilterRightItem={this.props.onPressProductFilterRightItem}
|
|
|
onPressCloseMoreFilter={this.props.onPressCloseMoreFilter}
|
|
|
onPressMoreFilter={this.props.onPressMoreFilter}/> : null}
|
|
|
|
|
|
|
|
|
{productList.isMoreFilter ?
|
|
|
<NewArrivalMoreFilter
|
|
|
style={{
|
...
|
...
|
@@ -313,6 +346,7 @@ let rowMarginTop = Math.ceil(10 * DEVICE_WIDTH_RATIO); |
|
|
let rowMarginBottom = Math.ceil(4 * DEVICE_WIDTH_RATIO);
|
|
|
|
|
|
let realHeight = rowHeight + rowMarginTop + rowMarginBottom;
|
|
|
let featuredHight = Math.ceil(((width-30)*220)/690);
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
...
|
...
|
|