...
|
...
|
@@ -34,9 +34,10 @@ export default class BrandListCell extends React.Component { |
|
|
<View style={styles.row}>
|
|
|
<Image
|
|
|
source={{uri: rowData.src}}
|
|
|
style={{ width: 100, height: 120}}
|
|
|
style={{ width: itemWidth, height: itemWidth}}
|
|
|
resizeMode={'contain'}
|
|
|
></Image>
|
|
|
<Text style={styles.text}>
|
|
|
<Text style={styles.text} numberOfLines={1}>
|
|
|
{rowData.name}
|
|
|
</Text>
|
|
|
</View>
|
...
|
...
|
@@ -49,7 +50,7 @@ export default class BrandListCell extends React.Component { |
|
|
let data = this.props.resource.toJS();
|
|
|
let list = data.brands;
|
|
|
|
|
|
if (list.length == 0) {
|
|
|
if (!list || list.length == 0) {
|
|
|
return null;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -69,39 +70,41 @@ export default class BrandListCell extends React.Component { |
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
let itemWidth= width/4;
|
|
|
let itemHeight = 50;
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
cellList:{
|
|
|
justifyContent: 'center',
|
|
|
width: Dimensions.get('window').width,
|
|
|
height: 200,
|
|
|
height: 180,
|
|
|
},
|
|
|
titleStyle:{
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center',
|
|
|
height: 64,
|
|
|
height: 48,
|
|
|
width:Dimensions.get('window').width,
|
|
|
backgroundColor: 'white',
|
|
|
backgroundColor: 'white',
|
|
|
},
|
|
|
row: {
|
|
|
justifyContent: 'center',
|
|
|
marginLeft: 20,
|
|
|
// margin: 3,
|
|
|
width: 100,
|
|
|
height: 100,
|
|
|
marginLeft: 10,
|
|
|
width: itemWidth,
|
|
|
height: itemWidth,
|
|
|
backgroundColor: 'white',
|
|
|
// alignItems: 'center',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
text: {
|
|
|
fontWeight: 'bold',
|
|
|
color: 'gray',
|
|
|
width: 100,
|
|
|
width: itemWidth,
|
|
|
textAlign: 'center',
|
|
|
backgroundColor:'white',
|
|
|
},
|
|
|
titleText: {
|
|
|
fontWeight: 'bold',
|
|
|
textAlign: 'center',
|
|
|
color: 'gray',
|
|
|
fontSize: 20,
|
|
|
fontSize: 16,
|
|
|
},
|
|
|
}); |
...
|
...
|
|