Authored by chenl

增加了YH_Image 圆角。review by yuliang。

... ... @@ -12,6 +12,15 @@ const {
const YH_ImageView = ReactNative.requireNativeComponent('YH_ImageView', null);
/**
* 原生图片
* 圆角设置规则:
* ios写法: masksToBounds={true} style中设置borderRadius圆角值
* android写法: radius={{'topLeft':'20','topRight':'20','bottomRight':'20','bottomLeft':'20'}}
*
*
**/
export default class YH_Image extends Component {
constructor(props) {
... ...
... ... @@ -39,10 +39,9 @@ export default class NewProductFloor extends Component{
let rightSmallTopRightImageUrl = SlicedImage.getSlicedUrl(imglst.get(3).get("src"), rightSmallImageWidth, rightSmallImageHeight, 2);
let rightSmallBottomRightImageUrl = SlicedImage.getSlicedUrl(imglst.get(4).get("src"), rightSmallImageWidth, rightSmallImageHeight, 2);
let containerHeight = 40 + leftBigImageHeight;
return(
<View style={[styles.container, {height: containerHeight}]}>
<View style={styles.container}>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')} onPressTitleMore={this.props.onPressTitleMore}/>
<View style={styles.imageContainer}>
... ... @@ -84,12 +83,15 @@ let leftBigImageWidth = width * 315 / 750;
let leftBigImageHeight = leftBigImageWidth * 420 / 315;
let rightSmallImageWidth = (width - leftBigImageWidth) / 2;
let rightSmallImageHeight = leftBigImageHeight / 2;
let containerHeight = 40 + leftBigImageHeight;
let styles = StyleSheet.create({
container: {
width: width,
height: containerHeight,
backgroundColor: "#e5e5e5",
},
... ...
... ... @@ -45,7 +45,7 @@ export default class PopularSingleProduct extends Component{
onPress={() => this.props.onPressImageItem && this.props.onPressImageItem(rowData.toJS())}>
<View style={styles.goodsContainer}>
<YH_Image style={styles.goodsImage} url={goodsImageUrl} />
<YH_Image style={styles.goodsImage} url={goodsImageUrl} />
<Text style={styles.goodsPrice} numberOfLines={1}>{goodsPrice}</Text>
<Text style={styles.goodsLookNum} numberOfLines={1}>{goodsLookNum}</Text>
<Text style={styles.goodsLookNum} numberOfLines={1}>正在浏览</Text>
... ... @@ -71,9 +71,8 @@ export default class PopularSingleProduct extends Component{
// let bannerImageUrl = SlicedImage.getSlicedUrl(bannerImage.get(0).get("src"), width, bannerHeight, 2);
let containerHeight = 40 + bannerHeight + 202;
return(
<View style={[styles.container, {height: containerHeight}]}>
<View style={styles.container}>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')} onPressTitleMore={this.props.onPressTitleMore} />
<ImageSlider
resource={banner}
... ... @@ -100,11 +99,14 @@ let bannerHeight = Math.ceil(width * 234 / 750);
let goodsImageWidth = Math.ceil(90);
let goodsImageHeight = Math.ceil(120);
width = Math.ceil(width);
let containerHeight = 40 + bannerHeight + 202;
let styles = StyleSheet.create({
container: {
width: width,
height: containerHeight,
backgroundColor: 'white'
},
... ... @@ -126,7 +128,7 @@ let styles = StyleSheet.create({
height: 178,
marginLeft: 11,
borderRadius: 3,
backgroundColor: 'white',
backgroundColor: '#f0f0f0',
},
goodsImage: {
... ...
... ... @@ -49,6 +49,7 @@ export default class SmallPic extends React.Component {
<YH_Image
url={url1}
masksToBounds={true}
radius={{'topLeft':'3','topRight':'3','bottomRight':'3','bottomLeft':'3'}}
style={[styles.image, styles.left]}
/>
</TouchableOpacity>
... ... @@ -61,6 +62,7 @@ export default class SmallPic extends React.Component {
<YH_Image
url={url2}
masksToBounds={true}
radius={{'topLeft':'3','topRight':'3','bottomRight':'3','bottomLeft':'3'}}
style={[styles.image, styles.right]}
/>
</TouchableOpacity>
... ...