Authored by chenl

增加了productList兼容性判断,修复了android 0.44不能显示价格的问题。

@@ -102,7 +102,7 @@ export default class ProductListCell extends Component { @@ -102,7 +102,7 @@ export default class ProductListCell extends Component {
102 } 102 }
103 103
104 _renderPrice() { 104 _renderPrice() {
105 - let {data, sourceType} = this.props; 105 + let {data, sourceType, fromPage} = this.props;
106 let isGlobalProduct = data.get('is_global') && data.get('is_global') == 'Y'; // 是否全球购商品 106 let isGlobalProduct = data.get('is_global') && data.get('is_global') == 'Y'; // 是否全球购商品
107 107
108 let salePrice = 0; // 售卖价 108 let salePrice = 0; // 售卖价
@@ -129,8 +129,11 @@ export default class ProductListCell extends Component { @@ -129,8 +129,11 @@ export default class ProductListCell extends Component {
129 salePriceColor = '#444444'; 129 salePriceColor = '#444444';
130 } 130 }
131 131
  132 + //新品到着升级为sectionList后价格会被遮挡
  133 + let priceMarginTop = (Platform.OS === 'android' && fromPage === 'newArrival') ? Math.ceil(-18 * DEVICE_WIDTH_RATIO) : Math.ceil(-4 * DEVICE_WIDTH_RATIO);
  134 +
132 return ( 135 return (
133 - <View style={styles.priceContainer}> 136 + <View style={[styles.priceContainer, {marginTop: priceMarginTop,} ]}>
134 <Text style={[styles.nowPrice, {color: salePriceColor}]} numberOfLines={1}>{salePriceStr}</Text> 137 <Text style={[styles.nowPrice, {color: salePriceColor}]} numberOfLines={1}>{salePriceStr}</Text>
135 {showOriginPrice ? <DeleteLineText 138 {showOriginPrice ? <DeleteLineText
136 style={styles.oldPriceContainer} 139 style={styles.oldPriceContainer}
@@ -203,8 +206,6 @@ let almostSoldOutImageTop = imageHeight - almostSoldOutImageHeight; @@ -203,8 +206,6 @@ let almostSoldOutImageTop = imageHeight - almostSoldOutImageHeight;
203 let nameMarginTop = Math.ceil(12 * DEVICE_WIDTH_RATIO); 206 let nameMarginTop = Math.ceil(12 * DEVICE_WIDTH_RATIO);
204 let nameHeight = Math.ceil(36 * DEVICE_WIDTH_RATIO); 207 let nameHeight = Math.ceil(36 * DEVICE_WIDTH_RATIO);
205 208
206 -let priceMarginTop = Math.ceil(-4 * DEVICE_WIDTH_RATIO);  
207 -  
208 let gpSoldOutImageHeight = Math.ceil(25 * DEVICE_WIDTH_RATIO); 209 let gpSoldOutImageHeight = Math.ceil(25 * DEVICE_WIDTH_RATIO);
209 210
210 let styles = StyleSheet.create({ 211 let styles = StyleSheet.create({
@@ -256,7 +257,6 @@ let styles = StyleSheet.create({ @@ -256,7 +257,6 @@ let styles = StyleSheet.create({
256 }, 257 },
257 priceContainer: { 258 priceContainer: {
258 flexDirection: 'row', 259 flexDirection: 'row',
259 - marginTop: priceMarginTop,  
260 }, 260 },
261 nowPrice: { 261 nowPrice: {
262 fontSize: 12, 262 fontSize: 12,
@@ -93,6 +93,7 @@ export default class NewArrivalCell extends Component { @@ -93,6 +93,7 @@ export default class NewArrivalCell extends Component {
93 rowID={index} 93 rowID={index}
94 data={rowData} 94 data={rowData}
95 similarIndex={similarIndex} 95 similarIndex={similarIndex}
  96 + fromPage={'newArrival'}
96 onPressProduct={this.props.onPressProductListProduct} 97 onPressProduct={this.props.onPressProductListProduct}
97 onLongPressProduct={this.props.onLongPressProduct} 98 onLongPressProduct={this.props.onLongPressProduct}
98 onPressFindSimilar={this.props.onPressFindSimilar} 99 onPressFindSimilar={this.props.onPressFindSimilar}