Authored by 孙凯

add 已售尽 需求 review by hongmo

... ... @@ -57,19 +57,21 @@ export default class ProductListCell extends Component {
let isGlobalProduct = data.get('is_global') && data.get('is_global') == 'Y'; // 是否全球购商品
let showGPLimitTag = isGlobalProduct && data.get('is_limited') && data.get('is_limited') == 'Y'; // 全球购限量商品
let showGPSoldOut = isGlobalProduct && data.get('is_stock') && data.get('is_stock') == 'Y'; // 全球购售罄
let showAlmostSoldOut = !isGlobalProduct && data.get('tags', []).indexOf('is_soon_sold_out') !== -1; // 非全球购的即将售罄
let showSoldOut = sourceType == 2 && data.get('storage_num') && data.get('storage_num') == 0; // 数据源是奥莱才显示
let showGPSoldOut = isGlobalProduct && data.get('is_stock') && data.get('is_stock') == 'Y'; // 全球购售罄
let showAlmostSoldOut = !isGlobalProduct && data.get('tags', []).indexOf('is_soon_sold_out') !== -1; // 非全球购的即将售罄
let showSoldOut = !isGlobalProduct && data.get('tags', []).indexOf('is_solded') !== -1; // 非全球购的即将售罄
let showOutletSoldOut = sourceType == 2 && data.get('storage_num') && data.get('storage_num') == 0; // 数据源是奥莱才显示
return (
<View style={styles.imageContainer}>
<Image style={styles.image} source={{uri: url}}>
{showAlmostSoldOut ? <Image style={styles.almostSoldOutImage} source={require('../../images/tag/tip_jjsq.png')}/> : null}
{showSoldOut ? <Image style={styles.soldOutImage} source={require('../../images/tag/outlet_sellout_bg.png')}/> : null}
{showOutletSoldOut ? <Image style={styles.soldOutImage} source={require('../../images/tag/outlet_sellout_bg.png')}/> : null}
{showGPSoldOut ? <Image style={styles.gpSoldOutImage} source={require('../../images/tag/gp_tip_SQ.png')}/> : null}
{showSoldOut ? <Image style={styles.almostSoldOutImage} source={require('../../images/tag/tip_ysq.png')}/> : null}
</Image>
</View>
);
... ... @@ -97,7 +99,7 @@ export default class ProductListCell extends Component {
salePriceStr = '¥' + salePrice.toFixed(2);
originPriceStr = '¥' + originPrice.toFixed(2);
}
if (!originPrice || (salePrice == originPrice)) {
showOriginPrice = false;
salePriceColor = '#444444';
... ... @@ -106,24 +108,24 @@ export default class ProductListCell extends Component {
return (
<View style={styles.priceContainer}>
<Text style={[styles.nowPrice, {color: salePriceColor}]} numberOfLines={1}>{salePriceStr}</Text>
{showOriginPrice ? <DeleteLineText
{showOriginPrice ? <DeleteLineText
style={styles.oldPriceContainer}
textStyle={styles.oldPrice}
lineStyle={styles.deleteLine}
text={originPriceStr}
text={originPriceStr}
/> : null}
</View>
);
}
render() {
let {data, sourceType, rowID, style} = this.props;
let name = data.get('product_name') ? data.get('product_name') : '';
return (
<TouchableOpacity
<TouchableOpacity
style={[styles.container, style]}
activeOpacity={1}
onPress={() => {
... ... @@ -135,7 +137,7 @@ export default class ProductListCell extends Component {
{this._renderTags()}
{this._renderImages()}
<View style={styles.nameContainer}>
<Text style={styles.name} numberOfLines={2}>{name}</Text>
</View>
... ... @@ -182,7 +184,7 @@ let styles = StyleSheet.create({
rowContainer: {
width: rowWidth,
height: Platform.OS === 'ios'?rowHeight:rowHeight+4,
},
imageContainer: {
width: rowWidth,
... ...