Authored by 于良

修改图片显示尺寸 review by shixiang

... ... @@ -65,19 +65,21 @@ export default class CouponCenter extends Component {
let bg = SlicedImage.getSlicedUrl(data.get('image').get('src'), 0, 0, 2);
let optImage;
let resizeMode = 'contain';
let marginTop = 0;
let imageStyle = {};
if (data.get('status') == 1) {
optImage = require('../../images/click-txt.png');
resizeMode = 'center';
marginTop = 0;
resizeMode = 'contain';
let marginTop = (rightHeight - 27) / 2;
let marginLeft = (rightWidth - 26) / 2
imageStyle = {width: 26, height: 27, marginTop, marginLeft};
} else if (data.get('status') == 2) {
optImage = require('../../images/zero.png');
resizeMode = 'contain';
marginTop = -9;
imageStyle = {marginTop: -9};
} else if (data.get('status') == 3) {
optImage = require('../../images/received.png');
resizeMode = 'contain';
marginTop = -9;
imageStyle = {marginTop: -9};
}
return (
<Image source={{uri: bg}} style={styles.couponContainer}>
... ... @@ -100,7 +102,7 @@ export default class CouponCenter extends Component {
}
}}
>
<Image source={optImage} resizeMode={resizeMode} style={[styles.rightImage, {marginTop}]}/>
<Image source={optImage} resizeMode={resizeMode} style={[styles.rightImage, imageStyle]}/>
</TouchableOpacity>
</Image>
);
... ...