...
|
...
|
@@ -6,6 +6,9 @@ import Swiper from 'react-native-swiper'; |
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
import SlicedImage from '../../../common/components/SlicedImage';
|
|
|
import Immutable, {Map} from 'immutable';
|
|
|
import YH_Image from '../../../common/components/YH_Image';
|
|
|
import {getSlicedUrl} from '../../utils/Utils';
|
|
|
import DeviceInfo from 'react-native-device-info';
|
|
|
|
|
|
const {
|
|
|
View,
|
...
|
...
|
@@ -68,7 +71,18 @@ export default class BrandSwiper extends React.Component { |
|
|
return null;
|
|
|
}
|
|
|
|
|
|
let needYH_Image = false;
|
|
|
|
|
|
if (Platform.OS === 'ios') {
|
|
|
let systemVersion = DeviceInfo.getSystemVersion();
|
|
|
systemVersion = parseFloat(systemVersion);
|
|
|
if (systemVersion < 8.0) {
|
|
|
needYH_Image = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (list.length == 1) {
|
|
|
let newSrc = getSlicedUrl(list[0].src, width, height);
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
...
|
...
|
@@ -79,7 +93,10 @@ export default class BrandSwiper extends React.Component { |
|
|
this.props.onPressSlideItem && this.props.onPressSlideItem(list[0].url, 0);
|
|
|
}}
|
|
|
>
|
|
|
<SlicedImage source={{uri: list[0].src}} style={{width, height}}/>
|
|
|
{needYH_Image ? <YH_Image
|
|
|
url={newSrc}
|
|
|
style={{width, height}}
|
|
|
/> : <SlicedImage source={{uri: list[0].src}} style={{width, height}}/>}
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
);
|
...
|
...
|
@@ -99,6 +116,8 @@ export default class BrandSwiper extends React.Component { |
|
|
paginationStyle={{backgroundColor: 'rgba(0,0,0,0.2)',bottom: 10,height: 10,width: list.length * 12,borderRadius: 5,marginLeft: (width-list.length * 12)/2}}
|
|
|
>
|
|
|
{list.map((item, i) => {
|
|
|
|
|
|
let newSrc = getSlicedUrl(item.src, width, height-15, 2);
|
|
|
return (
|
|
|
<TouchableOpacity
|
|
|
key={i}
|
...
|
...
|
@@ -107,7 +126,10 @@ export default class BrandSwiper extends React.Component { |
|
|
this.props.onPressSlideItem && this.props.onPressSlideItem(item.url, i);
|
|
|
}}
|
|
|
>
|
|
|
<SlicedImage source={{uri: item.src}} style={{width, height:height-15}}/>
|
|
|
{needYH_Image?<YH_Image
|
|
|
url={newSrc}
|
|
|
style={{width, height:height-15}}
|
|
|
/>:<SlicedImage source={{uri: item.src}} style={{width, height:height-15}}/>}
|
|
|
</TouchableOpacity>
|
|
|
);
|
|
|
})}
|
...
|
...
|
|