...
|
...
|
@@ -23,7 +23,8 @@ import BrandProductListCell from '../../../common/components/ListCell/ProductLis |
|
|
import TagsCell from './TagsCell'
|
|
|
import ShopCell from './ShopCell'
|
|
|
import ArticleCell from './ArticleCell'
|
|
|
import FeaturedView from './FeaturedView';
|
|
|
import FeaturedView from './FeaturedView'
|
|
|
import BannerCell from './BannerCell'
|
|
|
|
|
|
export default class NewArrival extends Component {
|
|
|
|
...
|
...
|
@@ -75,10 +76,15 @@ export default class NewArrival extends Component { |
|
|
_renderRow(rowData, sectionID, rowID) {
|
|
|
switch (sectionID) {
|
|
|
case 'banner': {
|
|
|
let {src} = rowData;
|
|
|
return (
|
|
|
<View style={{width,height:132}}>
|
|
|
<Image style={styles.bannerImage} source={{uri: 'http://imgsrc.baidu.com/forum/pic/item/770a6d2f12d46d7f71f05d7c.jpg'}}/>
|
|
|
<BannerCell
|
|
|
style={styles.bannerImage}
|
|
|
width={width}
|
|
|
height={117}
|
|
|
data={rowData}
|
|
|
onPress={this.props.onPressBanner}
|
|
|
/>
|
|
|
<View style={styles.separator}/>
|
|
|
</View>
|
|
|
);
|
...
|
...
|
@@ -95,25 +101,30 @@ export default class NewArrival extends Component { |
|
|
}
|
|
|
break;
|
|
|
case 'featured': {
|
|
|
let testData = ['http://imgsrc.baidu.com/forum/pic/item/770a6d2f12d46d7f71f05d7c.jpg',
|
|
|
'http://imgsrc.baidu.com/forum/pic/item/770a6d2f12d46d7f71f05d7c.jpg',
|
|
|
'http://imgsrc.baidu.com/forum/pic/item/770a6d2f12d46d7f71f05d7c.jpg',
|
|
|
'http://imgsrc.baidu.com/forum/pic/item/770a6d2f12d46d7f71f05d7c.jpg',
|
|
|
'http://imgsrc.baidu.com/forum/pic/item/770a6d2f12d46d7f71f05d7c.jpg',
|
|
|
];
|
|
|
let data = [];
|
|
|
for (var i = 0; i < rowData.length; i++) {
|
|
|
let {src} = rowData[i];
|
|
|
if (src) {
|
|
|
src = src.replace('{width}', width).replace('{height}', height).replace('{mode}',2);
|
|
|
data.push(src);
|
|
|
}
|
|
|
}
|
|
|
return (
|
|
|
<View>
|
|
|
<View style={{
|
|
|
width,
|
|
|
height: 171,
|
|
|
}}>
|
|
|
<FeaturedView
|
|
|
style={styles.carouselSection}
|
|
|
items={testData}
|
|
|
items={data}
|
|
|
onClick={(info) => {
|
|
|
let item = testData[info.index];
|
|
|
console.log(item);
|
|
|
let item = rowData[info.index];
|
|
|
let {url} = item;
|
|
|
this.props.onPressCarouselItem&&this.props.onPressCarouselItem(url);
|
|
|
}}
|
|
|
/>
|
|
|
<View style={styles.separator}/>
|
|
|
</View>
|
|
|
|
|
|
)
|
|
|
}
|
|
|
break;
|
...
|
...
|
@@ -133,18 +144,24 @@ export default class NewArrival extends Component { |
|
|
|
|
|
if (recommend_type == 'hotSearchTerm' || recommend_type == 'seasonSort') {
|
|
|
return (
|
|
|
<TagsCell style={[styles.listContainer, customStyle]} recommend_type={recommend_type} data={data}/>
|
|
|
<TagsCell
|
|
|
style={[styles.listContainer, customStyle]}
|
|
|
recommend_type={recommend_type}
|
|
|
data={data}
|
|
|
onPressCategory={this.props.onPressCategory}
|
|
|
onPressHotSearch={this.props.onPressHotSearch}
|
|
|
/>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
if (recommend_type == 'hotShop') {
|
|
|
return (
|
|
|
<ShopCell style={[styles.listContainer, customStyle]} data={data}/>
|
|
|
<ShopCell style={[styles.listContainer, customStyle]} data={data} onPressShop={this.props.onPressShop}/>
|
|
|
)
|
|
|
}
|
|
|
if (recommend_type == 'fashionArticle') {
|
|
|
return (
|
|
|
<ArticleCell style={[styles.listContainer, customStyle]} data={data}/>
|
|
|
<ArticleCell style={[styles.listContainer, customStyle]} data={data} onPressArticle={this.props.onPressArticle}/>
|
|
|
)
|
|
|
}
|
|
|
if (!recommend_type) {
|
...
|
...
|
@@ -232,16 +249,17 @@ export default class NewArrival extends Component { |
|
|
list,
|
|
|
} = productList.toJS();
|
|
|
|
|
|
let banner = topList?topList:[0];
|
|
|
let banner = topList&&topList.length?[topList]:[];
|
|
|
let latest = list?list:[0];
|
|
|
let recommend = [];
|
|
|
if (brandList&&brandList.length) {
|
|
|
recommend = [brandList];
|
|
|
}
|
|
|
let featured = featuredList&&featuredList.length?[featuredList]:[];
|
|
|
let dataSource = {
|
|
|
banner,
|
|
|
recommend,
|
|
|
'featured': [0],
|
|
|
featured,
|
|
|
latest,
|
|
|
}
|
|
|
let isLoadingMore = productList.isFetching && productList.currentPage > 0;
|
...
|
...
|
@@ -341,7 +359,7 @@ let styles = StyleSheet.create({ |
|
|
},
|
|
|
carouselSection: {
|
|
|
width,
|
|
|
height: 156,
|
|
|
height: 166,
|
|
|
},
|
|
|
brandFilterContainer: {
|
|
|
marginLeft: -1,
|
...
|
...
|
|