Authored by 孙凯

add 添加保护 review by hongmo

... ... @@ -27,8 +27,7 @@ export default class ShopTopBanner extends React.Component {
if (backgroundImage === '') {
return null;
}
let icon = info.shop_logo.replace('{width}', 100).replace('{height}', 100); // 商品缩略图
let icon = info&&info.shop_logo?info.shop_logo.replace('{width}', 100).replace('{height}', 100):''; // 商品缩略图
let name = info.is_show_shop_name == 'Y'?info.shop_name:null;
let buttonIcon = this.props.info.is_addFav?require('../../../../image/btn_gz_p.png'):require('../../../../image/btn_gz_n.png');
... ... @@ -41,7 +40,7 @@ export default class ShopTopBanner extends React.Component {
resizeMode={'cover'}
>
<Image
<Image
source={require('../../../../image/shop_banner_logobg.png')}
style={{width:backgroundWidth, position:'absolute', bottom:0, backgroundColor:'transparent'}}/>
... ...
... ... @@ -27,7 +27,7 @@ export default class BrandCell extends Component {
let shop_logo = data.get('shop_logo');
let shops_id = data.get('shops_id');
let new_product_num = data.get('new_product_num');
shop_logo = shop_logo.replace('{width}', 166).replace('{height}', 68).replace('{mode}',2);
shop_logo = shop_logo?shop_logo.replace('{width}', 166).replace('{height}', 68).replace('{mode}',2):'';
return (
<TouchableOpacity style={styles.container} onPress={()=>{this.props.onPressShop&&this.props.onPressShop(data, index);}}>
<View style={{flex:1}}>
... ...