Authored by yoho-js001

Fix bug on BLK brand. reviewed by 凯总。

... ... @@ -64,11 +64,6 @@ export default class BannerReourceList extends React.Component {
resizeMode={'contain'}
></Image>}
<View style={styles.textV}>
<Text style={styles.text} numberOfLines={1}>
{rowData.name}
</Text>
</View>
</View>
</TouchableOpacity>
);
... ... @@ -79,19 +74,18 @@ export default class BannerReourceList extends React.Component {
let custom_brands = resource.get('custom_brands');
let res = custom_brands.toJS();
let data = res.data;
let title = data?data.title:null;
let list = data?data.list:null;
if (!custom_brands || custom_brands.size == 0 || !list) {
if (!custom_brands ||!data ||data.length == 0) {
return null;
}
return (
<View style={styles.cellList}>
<ListView
dataSource={this.dataSource.cloneWithRows(list)}
dataSource={this.dataSource.cloneWithRows(data)}
horizontal={true}
renderRow={this.renderRow.bind(this)}
/>
... ... @@ -145,6 +139,7 @@ let styles = StyleSheet.create({
width: itemWidth,
height: itemHeight,
backgroundColor: 'white',
marginTop: 10,
},
thumbnail: {
width: itemWidth,
... ...
... ... @@ -378,6 +378,8 @@ export function getBrandResource(channel) {
return new BrandService(app.serviceHost).getBrandResource(channel, content_code)
.then(json => {
let payload = parseResourceResources(json);
console.log('aaaaa');
console.log(payload);
if (channel == 1) {
dispatch(getBrandResourceForBoySuccess(payload));
}else if (channel == 2) {
... ... @@ -410,14 +412,13 @@ export function parseResourceResources(json) {
let banner = [];
let custom_brands = [];
let brandsText = [];
brandsText.push({key: 'default',name: '全部品牌'});
for (var i = 0; i < json.length; i++) {
if (json[i].template_name == 'focus') {
if (json[i].template_name == 'focus'&&json[i].focus_type == '1') {
banner = json[i];
}
if (json[i].template_name == 'custom_brands') {
if (json[i].template_name == 'focus'&&json[i].focus_type == '2') {
custom_brands = json[i];
}
if (json[i].template_name == 'text') {
... ...