Authored by 孙凯

add 已售尽 需求 review by hongmo

@@ -57,19 +57,21 @@ export default class ProductListCell extends Component { @@ -57,19 +57,21 @@ export default class ProductListCell extends Component {
57 57
58 let isGlobalProduct = data.get('is_global') && data.get('is_global') == 'Y'; // 是否全球购商品 58 let isGlobalProduct = data.get('is_global') && data.get('is_global') == 'Y'; // 是否全球购商品
59 59
60 - 60 +
61 let showGPLimitTag = isGlobalProduct && data.get('is_limited') && data.get('is_limited') == 'Y'; // 全球购限量商品 61 let showGPLimitTag = isGlobalProduct && data.get('is_limited') && data.get('is_limited') == 'Y'; // 全球购限量商品
62 - let showGPSoldOut = isGlobalProduct && data.get('is_stock') && data.get('is_stock') == 'Y'; // 全球购售罄  
63 -  
64 - let showAlmostSoldOut = !isGlobalProduct && data.get('tags', []).indexOf('is_soon_sold_out') !== -1; // 非全球购的即将售罄  
65 - let showSoldOut = sourceType == 2 && data.get('storage_num') && data.get('storage_num') == 0; // 数据源是奥莱才显示 62 + let showGPSoldOut = isGlobalProduct && data.get('is_stock') && data.get('is_stock') == 'Y'; // 全球购售罄
  63 +
  64 + let showAlmostSoldOut = !isGlobalProduct && data.get('tags', []).indexOf('is_soon_sold_out') !== -1; // 非全球购的即将售罄
  65 + let showSoldOut = !isGlobalProduct && data.get('tags', []).indexOf('is_solded') !== -1; // 非全球购的即将售罄
  66 + let showOutletSoldOut = sourceType == 2 && data.get('storage_num') && data.get('storage_num') == 0; // 数据源是奥莱才显示
66 67
67 return ( 68 return (
68 <View style={styles.imageContainer}> 69 <View style={styles.imageContainer}>
69 <Image style={styles.image} source={{uri: url}}> 70 <Image style={styles.image} source={{uri: url}}>
70 {showAlmostSoldOut ? <Image style={styles.almostSoldOutImage} source={require('../../images/tag/tip_jjsq.png')}/> : null} 71 {showAlmostSoldOut ? <Image style={styles.almostSoldOutImage} source={require('../../images/tag/tip_jjsq.png')}/> : null}
71 - {showSoldOut ? <Image style={styles.soldOutImage} source={require('../../images/tag/outlet_sellout_bg.png')}/> : null} 72 + {showOutletSoldOut ? <Image style={styles.soldOutImage} source={require('../../images/tag/outlet_sellout_bg.png')}/> : null}
72 {showGPSoldOut ? <Image style={styles.gpSoldOutImage} source={require('../../images/tag/gp_tip_SQ.png')}/> : null} 73 {showGPSoldOut ? <Image style={styles.gpSoldOutImage} source={require('../../images/tag/gp_tip_SQ.png')}/> : null}
  74 + {showSoldOut ? <Image style={styles.almostSoldOutImage} source={require('../../images/tag/tip_ysq.png')}/> : null}
73 </Image> 75 </Image>
74 </View> 76 </View>
75 ); 77 );
@@ -97,7 +99,7 @@ export default class ProductListCell extends Component { @@ -97,7 +99,7 @@ export default class ProductListCell extends Component {
97 salePriceStr = '¥' + salePrice.toFixed(2); 99 salePriceStr = '¥' + salePrice.toFixed(2);
98 originPriceStr = '¥' + originPrice.toFixed(2); 100 originPriceStr = '¥' + originPrice.toFixed(2);
99 } 101 }
100 - 102 +
101 if (!originPrice || (salePrice == originPrice)) { 103 if (!originPrice || (salePrice == originPrice)) {
102 showOriginPrice = false; 104 showOriginPrice = false;
103 salePriceColor = '#444444'; 105 salePriceColor = '#444444';
@@ -106,24 +108,24 @@ export default class ProductListCell extends Component { @@ -106,24 +108,24 @@ export default class ProductListCell extends Component {
106 return ( 108 return (
107 <View style={styles.priceContainer}> 109 <View style={styles.priceContainer}>
108 <Text style={[styles.nowPrice, {color: salePriceColor}]} numberOfLines={1}>{salePriceStr}</Text> 110 <Text style={[styles.nowPrice, {color: salePriceColor}]} numberOfLines={1}>{salePriceStr}</Text>
109 - {showOriginPrice ? <DeleteLineText 111 + {showOriginPrice ? <DeleteLineText
110 style={styles.oldPriceContainer} 112 style={styles.oldPriceContainer}
111 textStyle={styles.oldPrice} 113 textStyle={styles.oldPrice}
112 lineStyle={styles.deleteLine} 114 lineStyle={styles.deleteLine}
113 - text={originPriceStr} 115 + text={originPriceStr}
114 /> : null} 116 /> : null}
115 </View> 117 </View>
116 - 118 +
117 ); 119 );
118 } 120 }
119 121
120 - 122 +
121 render() { 123 render() {
122 let {data, sourceType, rowID, style} = this.props; 124 let {data, sourceType, rowID, style} = this.props;
123 let name = data.get('product_name') ? data.get('product_name') : ''; 125 let name = data.get('product_name') ? data.get('product_name') : '';
124 126
125 return ( 127 return (
126 - <TouchableOpacity 128 + <TouchableOpacity
127 style={[styles.container, style]} 129 style={[styles.container, style]}
128 activeOpacity={1} 130 activeOpacity={1}
129 onPress={() => { 131 onPress={() => {
@@ -135,7 +137,7 @@ export default class ProductListCell extends Component { @@ -135,7 +137,7 @@ export default class ProductListCell extends Component {
135 {this._renderTags()} 137 {this._renderTags()}
136 138
137 {this._renderImages()} 139 {this._renderImages()}
138 - 140 +
139 <View style={styles.nameContainer}> 141 <View style={styles.nameContainer}>
140 <Text style={styles.name} numberOfLines={2}>{name}</Text> 142 <Text style={styles.name} numberOfLines={2}>{name}</Text>
141 </View> 143 </View>
@@ -182,7 +184,7 @@ let styles = StyleSheet.create({ @@ -182,7 +184,7 @@ let styles = StyleSheet.create({
182 rowContainer: { 184 rowContainer: {
183 width: rowWidth, 185 width: rowWidth,
184 height: Platform.OS === 'ios'?rowHeight:rowHeight+4, 186 height: Platform.OS === 'ios'?rowHeight:rowHeight+4,
185 - 187 +
186 }, 188 },
187 imageContainer: { 189 imageContainer: {
188 width: rowWidth, 190 width: rowWidth,