...
|
...
|
@@ -113,23 +113,103 @@ export default class NewArrival extends Component { |
|
|
data.push(src);
|
|
|
}
|
|
|
}
|
|
|
return (
|
|
|
<View style={{
|
|
|
width,
|
|
|
height: 181,
|
|
|
}}>
|
|
|
<FeaturedView
|
|
|
style={styles.carouselSection}
|
|
|
items={data}
|
|
|
onClick={(info) => {
|
|
|
let item = rowData.toArray()[info.index];
|
|
|
if(data.length==1){
|
|
|
return (
|
|
|
<View style={{
|
|
|
width,
|
|
|
height: featuredHigh+50,
|
|
|
|
|
|
alignItems: 'center',
|
|
|
}}>
|
|
|
<Text style={styles.headerText} >
|
|
|
精选抢先看
|
|
|
</Text>
|
|
|
<TouchableOpacity
|
|
|
activeOpacity={0.8}
|
|
|
onPress={() => {
|
|
|
let item = rowData.toArray()[0];
|
|
|
let url = item.get('url');
|
|
|
this.props.onPressCarouselItem&&this.props.onPressCarouselItem(url);
|
|
|
}}
|
|
|
/>
|
|
|
<View style={styles.separator}/>
|
|
|
</View>
|
|
|
)
|
|
|
>
|
|
|
<Image
|
|
|
style={styles.carouselSectionImage}
|
|
|
source={{uri: data[0]}}
|
|
|
resizeMode={'cover'}
|
|
|
/>
|
|
|
</TouchableOpacity>
|
|
|
<View style={styles.separator}/>
|
|
|
</View>
|
|
|
)
|
|
|
}else if(data.length==2){
|
|
|
|
|
|
return (
|
|
|
<View style={{
|
|
|
width,
|
|
|
height: (((width-48) / 2)*220)/330+58,
|
|
|
}}>
|
|
|
<Text style={styles.headerText} >
|
|
|
精选抢先看
|
|
|
</Text>
|
|
|
<View style={{
|
|
|
width,
|
|
|
height: (((width-48) / 2)*220)/330,
|
|
|
flexDirection:'row',
|
|
|
marginLeft:8,
|
|
|
marginRight:8,
|
|
|
marginBottom:8,
|
|
|
}}>
|
|
|
<TouchableOpacity
|
|
|
activeOpacity={0.8}
|
|
|
onPress={() => {
|
|
|
let item = rowData.toArray()[0];
|
|
|
let url = item.get('url');
|
|
|
this.props.onPressCarouselItem&&this.props.onPressCarouselItem(url);
|
|
|
}}
|
|
|
>
|
|
|
<Image
|
|
|
style={styles.carouselSection2Image}
|
|
|
source={{uri: data[0]}}
|
|
|
resizeMode={'cover'}
|
|
|
/>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity
|
|
|
activeOpacity={0.8}
|
|
|
onPress={() => {
|
|
|
let item = rowData.toArray()[1];
|
|
|
let url = item.get('url');
|
|
|
this.props.onPressCarouselItem&&this.props.onPressCarouselItem(url);
|
|
|
}}
|
|
|
>
|
|
|
<Image
|
|
|
style={styles.carouselSection2Image}
|
|
|
source={{uri: data[1]}}
|
|
|
resizeMode={'cover'}
|
|
|
/>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
<View style={styles.separator}/>
|
|
|
</View>
|
|
|
)
|
|
|
}else{
|
|
|
return (
|
|
|
<View style={{
|
|
|
width,
|
|
|
height: 181,
|
|
|
}}>
|
|
|
<FeaturedView
|
|
|
style={styles.carouselSection}
|
|
|
items={data}
|
|
|
onClick={(info) => {
|
|
|
let item = rowData.toArray()[info.index];
|
|
|
let url = item.get('url');
|
|
|
this.props.onPressCarouselItem&&this.props.onPressCarouselItem(url);
|
|
|
}}
|
|
|
/>
|
|
|
<View style={styles.separator}/>
|
|
|
</View>
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case 'latest': {
|
...
|
...
|
@@ -334,6 +414,7 @@ let rowWidth = Math.ceil(137.5 * width / 320); |
|
|
let rowHeight = Math.ceil(254 * width / 320);
|
|
|
let rowMarginTop = Math.ceil(10 * width / 320);
|
|
|
let rowMarginHorizontal = (width - rowWidth * 2) / 3;
|
|
|
let featuredHigh=Math.ceil(((width-30)*220)/690);
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
...
|
...
|
@@ -369,6 +450,22 @@ let styles = StyleSheet.create({ |
|
|
width,
|
|
|
height: 166,
|
|
|
},
|
|
|
carouselSectionImage:{
|
|
|
width:width-30,
|
|
|
height: featuredHigh,
|
|
|
marginLeft:8,
|
|
|
marginRight:8,
|
|
|
marginBottom:8,
|
|
|
borderRadius:3,
|
|
|
},
|
|
|
carouselSection2Image:{
|
|
|
width:(width-48) / 2,
|
|
|
height: (((width-48) / 2)*220)/330,
|
|
|
flex:1,
|
|
|
marginLeft:8,
|
|
|
marginRight:8,
|
|
|
borderRadius:3,
|
|
|
},
|
|
|
brandFilterContainer: {
|
|
|
marginLeft: -1,
|
|
|
width: width + 2,
|
...
|
...
|
@@ -383,5 +480,13 @@ let styles = StyleSheet.create({ |
|
|
top: height - 44 - 20 - 64,
|
|
|
width: 44,
|
|
|
height: 44,
|
|
|
}
|
|
|
},
|
|
|
headerText: {
|
|
|
fontSize: 14,
|
|
|
color: 'black',
|
|
|
width: width,
|
|
|
textAlign: 'center',
|
|
|
marginTop:10,
|
|
|
marginBottom:10,
|
|
|
},
|
|
|
}); |
...
|
...
|
|