Authored by 鹿亮亮

修复ActivityProductFloor楼层商品有白边 review by 陈林

@@ -57,21 +57,24 @@ export default class ActivityProductFloor extends Component { @@ -57,21 +57,24 @@ export default class ActivityProductFloor extends Component {
57 let productSkn = rowData.get('product_skn'); 57 let productSkn = rowData.get('product_skn');
58 let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth,120,2); 58 let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth,120,2);
59 return ( 59 return (
60 - <View style={styles.row}>  
61 - <YH_Image style={styles.image}  
62 - url={imgUrl}/>  
63 - <Text style={styles.vipText} numberOfLines={1}>{productPrice}</Text>  
64 - {  
65 - this._isShowOrignPrice(type) ?  
66 - <View style={styles.vipContainer}>  
67 - <Text style={styles.discountText} numberOfLines={1}>{orginPrice}</Text>  
68 - {  
69 - this._isShowVip(type) ? <Image style={{width:33,height:12,marginLeft:2}}  
70 - source={require('../../images/ic_vip_red.png')}/> : null  
71 - }  
72 - </View> : null  
73 - }  
74 - </View>); 60 + <TouchableOpacity activeOpacity={1}
  61 + onPress={()=>this.props.onPressVipProduct && this.props.onPressVipProduct(productId,productSkn)}>
  62 + <View style={styles.row}>
  63 + <YH_Image style={styles.image}
  64 + url={imgUrl}/>
  65 + <Text style={styles.vipText} numberOfLines={1}>{productPrice}</Text>
  66 + {
  67 + this._isShowOrignPrice(type) ?
  68 + <View style={styles.vipContainer}>
  69 + <Text style={styles.discountText} numberOfLines={1}>{orginPrice}</Text>
  70 + {
  71 + this._isShowVip(type) ? <Image style={{width:33,height:12,marginLeft:2}}
  72 + source={require('../../images/ic_vip_red.png')}/> : null
  73 + }
  74 + </View> : null
  75 + }
  76 + </View>
  77 + </TouchableOpacity>);
75 } 78 }
76 79
77 render() { 80 render() {
@@ -83,21 +86,23 @@ export default class ActivityProductFloor extends Component { @@ -83,21 +86,23 @@ export default class ActivityProductFloor extends Component {
83 let bannerData = data.get('banner_image'); 86 let bannerData = data.get('banner_image');
84 let productData = data.get('list'); 87 let productData = data.get('list');
85 let type = data.get('type'); 88 let type = data.get('type');
  89 +
86 let cellH = this._isShowOrignPrice(type) ? cellHeight : cellHeight - 20; 90 let cellH = this._isShowOrignPrice(type) ? cellHeight : cellHeight - 20;
  91 + let floorH = cellH + 40 + bannerHeight;
87 return ( 92 return (
88 - <View style={styles.container}> 93 + <View style={{backgroundColor: 'white',width:width,height:floorH}}>
89 <HeadTitleCell title={title} moreUrl={moreUrl}/> 94 <HeadTitleCell title={title} moreUrl={moreUrl}/>
90 <Banner 95 <Banner
91 data={bannerData} 96 data={bannerData}
92 duration={8} 97 duration={8}
93 width={width} 98 width={width}
94 height={bannerHeight} 99 height={bannerHeight}
95 - onPress={this.onPressBanner} 100 + onPress={this.props.onPressVipBannerItem}
96 /> 101 />
97 102
98 - <View style={styles.listContianer,{height:cellH}}> 103 + <View style={{width:width,alignItems:'center',height:cellH}}>
99 {visible ? 104 {visible ?
100 - <YH_Image style={styles.listBg,{height:cellH}} 105 + <YH_Image style={{width: width,height:cellH}}
101 url={SlicedImage.getSlicedUrl(bgUrl,width,cellH)}/> : null} 106 url={SlicedImage.getSlicedUrl(bgUrl,width,cellH)}/> : null}
102 <ListView 107 <ListView
103 style={{position:'absolute',left:0,top:5,paddingTop:12,paddingBottom:12}} 108 style={{position:'absolute',left:0,top:5,paddingTop:12,paddingBottom:12}}
@@ -116,7 +121,7 @@ export default class ActivityProductFloor extends Component { @@ -116,7 +121,7 @@ export default class ActivityProductFloor extends Component {
116 let {width, height} = Dimensions.get('window'); 121 let {width, height} = Dimensions.get('window');
117 let bannerHeight = Math.ceil((234 / 750) * width); 122 let bannerHeight = Math.ceil((234 / 750) * width);
118 let sectionHeight = Math.ceil((419 / 750) * width); 123 let sectionHeight = Math.ceil((419 / 750) * width);
119 -let cellWidth = 95; 124 +let cellWidth = 90;
120 let cellHeight = 210; 125 let cellHeight = 210;
121 126
122 //1 VIP 专享 2 新人专享 3 学生专享 4 新品到着 127 //1 VIP 专享 2 新人专享 3 学生专享 4 新品到着
@@ -125,17 +130,7 @@ const TYPE_NEW_USER = 2; @@ -125,17 +130,7 @@ const TYPE_NEW_USER = 2;
125 const TYPE_STUDENT = 3; 130 const TYPE_STUDENT = 3;
126 const TYPE_NEW_PRODUCT = 4; 131 const TYPE_NEW_PRODUCT = 4;
127 const styles = StyleSheet.create({ 132 const styles = StyleSheet.create({
128 - container: {  
129 - backgroundColor: 'white',  
130 - },  
131 - listContianer: {  
132 - width:width,  
133 - alignItems: 'center',  
134 - },  
135 - listBg: {  
136 - width: width,  
137 - height: cellHeight,  
138 - }, 133 +
139 listContent: { 134 listContent: {
140 backgroundColor: 'transparent', 135 backgroundColor: 'transparent',
141 flexDirection: 'row', 136 flexDirection: 'row',
@@ -144,13 +139,10 @@ const styles = StyleSheet.create({ @@ -144,13 +139,10 @@ const styles = StyleSheet.create({
144 paddingHorizontal: 5, 139 paddingHorizontal: 5,
145 }, 140 },
146 row: { 141 row: {
147 - flexDirection: 'column',  
148 width: cellWidth, 142 width: cellWidth,
149 - backgroundColor: '#f0f0f0', 143 + backgroundColor: 'white',
150 borderRadius: 3, 144 borderRadius: 3,
151 - justifyContent: 'center',  
152 - marginLeft: 6,  
153 - marginRight: 6 145 + marginLeft: 11,
154 }, 146 },
155 vipContainer: { 147 vipContainer: {
156 width: cellWidth, 148 width: cellWidth,
@@ -170,7 +162,6 @@ const styles = StyleSheet.create({ @@ -170,7 +162,6 @@ const styles = StyleSheet.create({
170 }, 162 },
171 vipText: { 163 vipText: {
172 color: '#d0021b', 164 color: '#d0021b',
173 - flex: 1,  
174 marginTop: 7, 165 marginTop: 7,
175 marginBottom: 7, 166 marginBottom: 7,
176 textAlign: 'center', 167 textAlign: 'center',
@@ -96,7 +96,7 @@ export default class VipUserFloor extends Component { @@ -96,7 +96,7 @@ export default class VipUserFloor extends Component {
96 let {width, height} = Dimensions.get('window'); 96 let {width, height} = Dimensions.get('window');
97 let bannerHeight = Math.ceil((234 / 750) * width); 97 let bannerHeight = Math.ceil((234 / 750) * width);
98 let sectionHeight = Math.ceil((419 / 750) * width); 98 let sectionHeight = Math.ceil((419 / 750) * width);
99 -let cellWidth = 95; 99 +let cellWidth = 90;
100 let cellHeight = 210; 100 let cellHeight = 210;
101 101
102 const styles = StyleSheet.create({ 102 const styles = StyleSheet.create({