...
|
...
|
@@ -16,6 +16,10 @@ import {Map} from 'immutable'; |
|
|
import BrandSwiper from './BrandSwiper';
|
|
|
import BannerReourceList from './BannerReourceList';
|
|
|
import BrandFliter from './BrandFliter';
|
|
|
import ChannelFliter from './ChannelFliter';
|
|
|
import AllBrandListCell from './AllBrandListCell';
|
|
|
import NewHotBannerListCell from './NewHotBannerListCell';
|
|
|
|
|
|
|
|
|
|
|
|
export default class Brand extends Component {
|
...
|
...
|
@@ -41,14 +45,6 @@ export default class Brand extends Component { |
|
|
|
|
|
}
|
|
|
|
|
|
renderSectionHeader(sectionData, sectionID) {
|
|
|
return (
|
|
|
<View style={styles.sessionTitle}>
|
|
|
<Text style={styles.sessionText}>{sectionID}</Text>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
renderHeader(){
|
|
|
let data = this.props.reourceForBoy;
|
|
|
let bannerForBoy = data.get('bannerForBoy');
|
...
|
...
|
@@ -64,39 +60,22 @@ export default class Brand extends Component { |
|
|
);
|
|
|
}
|
|
|
|
|
|
renderSectionHeader(sectionData, sectionID) {
|
|
|
return (
|
|
|
<View style={styles.sessionTitle}>
|
|
|
<Text style={styles.sessionText}>{sectionID}</Text>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
|
|
if (this.props.brandFliter == 0) {
|
|
|
let name = rowData.brand_name;
|
|
|
let is_hot = rowData.is_hot;
|
|
|
let is_show_new = rowData.is_show_new;
|
|
|
|
|
|
return (
|
|
|
<View style={styles.rowTitle}>
|
|
|
<Text style={styles.rowText}>{name}</Text>
|
|
|
{is_show_new=='Y'?<View style={styles.new}><Text style={styles.text}>NEW</Text></View>:null}
|
|
|
{is_hot=='Y'?<View style={styles.hot}><Text style={styles.text}>HOT</Text></View>:null}
|
|
|
</View>
|
|
|
<AllBrandListCell rowData={rowData}/>
|
|
|
);
|
|
|
}else {
|
|
|
let newSrc = rowData?rowData.brand_ico.replace('{mode}', 1)
|
|
|
.replace('{width}', itemWidth)
|
|
|
.replace('{height}', itemWidth):rowData.brand_ico;
|
|
|
return (
|
|
|
<TouchableOpacity activeOpacity={0.5} onPress={() => {
|
|
|
// this.props.onPressRecommendItem && this.props.onPressRecommendItem(rowData.get('url'));
|
|
|
}}>
|
|
|
<View style={styles.rowContainer}>
|
|
|
<Image
|
|
|
source={{uri: newSrc}}
|
|
|
style={styles.thumbnail}
|
|
|
>
|
|
|
|
|
|
<View style={styles.itemTitle}>
|
|
|
<Text style={styles.itemText} numberOfLines={1}>{rowData.brand_name}</Text>
|
|
|
</View>
|
|
|
</Image>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
<NewHotBannerListCell rowData={rowData}/>
|
|
|
);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -136,6 +115,7 @@ export default class Brand extends Component { |
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<ChannelFliter selectID={0} onChannelPressFliter={this.props.onChannelPressFliter}/>
|
|
|
<ListView
|
|
|
contentContainerStyle={contentContainerStyle}
|
|
|
enableEmptySections={true}
|
...
|
...
|
@@ -150,7 +130,6 @@ export default class Brand extends Component { |
|
|
}
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
let itemWidth = width / 3;
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
...
|
...
|
@@ -180,61 +159,4 @@ let styles = StyleSheet.create({ |
|
|
width,
|
|
|
backgroundColor: '#444',
|
|
|
},
|
|
|
rowText: {
|
|
|
textAlign: 'left',
|
|
|
fontSize: 14,
|
|
|
marginLeft:10,
|
|
|
},
|
|
|
rowTitle: {
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
height: 44,
|
|
|
width,
|
|
|
backgroundColor: 'white',
|
|
|
borderBottomColor: 'black',
|
|
|
borderBottomWidth: 0.5,
|
|
|
},
|
|
|
hot: {
|
|
|
alignItems: 'center',
|
|
|
height: 15,
|
|
|
width: 30,
|
|
|
backgroundColor: 'red',
|
|
|
marginLeft: 10,
|
|
|
justifyContent: 'center',
|
|
|
borderRadius: 30,
|
|
|
},
|
|
|
new: {
|
|
|
alignItems: 'center',
|
|
|
height: 15,
|
|
|
width: 30,
|
|
|
backgroundColor: 'green',
|
|
|
marginLeft: 10,
|
|
|
justifyContent: 'center',
|
|
|
borderRadius: 50,
|
|
|
},
|
|
|
text: {
|
|
|
textAlign: 'left',
|
|
|
fontSize: 10,
|
|
|
color: 'white',
|
|
|
},
|
|
|
thumbnail: {
|
|
|
borderWidth: 0.5,
|
|
|
borderColor: '#CCC',
|
|
|
width: itemWidth,
|
|
|
height: itemWidth,
|
|
|
},
|
|
|
itemTitle: {
|
|
|
marginLeft:5,
|
|
|
marginTop: itemWidth - 30,
|
|
|
justifyContent: 'center',
|
|
|
height: 30,
|
|
|
width: itemWidth - 10,
|
|
|
backgroundColor: 'transparent',
|
|
|
},
|
|
|
itemText: {
|
|
|
fontWeight: 'bold',
|
|
|
textAlign: 'center',
|
|
|
color: 'gray',
|
|
|
fontSize: 10,
|
|
|
},
|
|
|
}); |
...
|
...
|
|