Authored by 张丽霞

下架商品信息不展示,review by 孙凯

... ... @@ -45,6 +45,9 @@ export default class DoubleImage extends React.Component {
let linkType1 = data1.linkType;
let showProductInfo1 = data1.showProductInfo;
let product1 = data1.product;
if (!product1) {
showProductInfo1 = false;
}
let salePrice1 = product1?parseFloat(product1.sales_price):0;
let originPrice1 = product1?parseFloat(product1.market_price):0;
let name1 = product1?product1.product_name:'';
... ... @@ -58,6 +61,9 @@ export default class DoubleImage extends React.Component {
let linkType2 = data2.linkType;
let showProductInfo2 = data2.showProductInfo;
let product2 = data2.product;
if (!product2) {
showProductInfo2 = false;
}
let salePrice2 = product2?parseFloat(product2.sales_price):0;
let originPrice2 = product2?parseFloat(product2.market_price):0;
let name2 = product2?product2.product_name:'';
... ...
... ... @@ -49,6 +49,9 @@ export default class SingleImage extends React.Component {
let imageHeight = (imageH*width)/(imageW==0?1:imageW);//根据返回信息计算出高度
let backgroundHeight =isModuleMargin=='1'?(imageHeight+10):imageHeight;
let product = data.product;
if (!product) {
showProductInfo = false;
}
let salePrice = product?parseFloat(product.sales_price):0;
let originPrice = product?parseFloat(product.market_price):0;
let name = product?product.product_name:'';
... ...
... ... @@ -33,6 +33,9 @@ export default class RedPersonPicThree extends Component{
let linkType1 = data1.linkType;
let showProductInfo1 = data1.showProductInfo;
let product1 = data1.product;
if (!product1) {
showProductInfo1 = false;
}
let salePrice1 = product1?parseFloat(product1.sales_price):0;
let originPrice1 = product1?parseFloat(product1.market_price):0;
let name1 = product1?product1.product_name:'';
... ... @@ -46,6 +49,9 @@ export default class RedPersonPicThree extends Component{
let linkType2 = data2.linkType;
let showProductInfo2 = data2.showProductInfo;
let product2 = data2.product;
if (!product2) {
showProductInfo2 = false;
}
let salePrice2 = product2?parseFloat(product2.sales_price):0;
let originPrice2 = product2?parseFloat(product2.market_price):0;
let name2 = product2?product2.product_name:'';
... ... @@ -59,6 +65,9 @@ export default class RedPersonPicThree extends Component{
let linkType3 = data3.linkType;
let showProductInfo3 = data3.showProductInfo;
let product3 = data3.product;
if (!product3) {
showProductInfo3 = false;
}
let salePrice3 = product3?parseFloat(product3.sales_price):0;
let originPrice3= product3?parseFloat(product3.market_price):0;
let name3 = product3?product3.product_name:'';
... ... @@ -165,21 +174,21 @@ export default class RedPersonPicThree extends Component{
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth3+nullHeigth:containerHeigth3,backgroundColor: '#f0f0f0'}}>
<TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} >
<YH_Image url={backgroundImage1} style={[styles.imagetype3,{resizeMode: 'contain'}]}/>
{linkType1=='1'?<View style={styles.maskContainer3}>
{linkType1=='1' && showProductInfo1?<View style={styles.maskContainer3}>
<Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble1?'red':'white',}}>{price1}</Text>
{saleAble1?<Text style={styles.deleteSale}>{sale1}</Text>:null}
</View>:null}
</TouchableOpacity>
<TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} >
<YH_Image url={backgroundImage2} style={[styles.imagetype3,{resizeMode: 'contain'}]}/>
{linkType2=='1'?<View style={styles.maskContainer3}>
{linkType2=='1' && showProductInfo2?<View style={styles.maskContainer3}>
<Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble2?'red':'white',}}>{price2}</Text>
{saleAble2?<Text style={styles.deleteSale}>{sale2}</Text>:null}
</View>:null}
</TouchableOpacity>
<TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} >
<YH_Image url={backgroundImage3} style={[styles.imagetype3,{resizeMode: 'contain'}]}/>
{linkType3=='1'?<View style={styles.maskContainer3}>
{linkType3=='1' && showProductInfo3?<View style={styles.maskContainer3}>
<Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble3?'red':'white',}}>{price3}</Text>
{saleAble3?<Text style={styles.deleteSale}>{sale3}</Text>:null}
</View>:null}
... ... @@ -193,7 +202,7 @@ export default class RedPersonPicThree extends Component{
<View style={styles.subContainer}>
<TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} >
<YH_Image url={backgroundImage1} style={[styles.image,{resizeMode: 'contain'}]}/>
{linkType1=='1'?<View style={styles.maskContainer1}>
{linkType1=='1' && showProductInfo1?<View style={styles.maskContainer1}>
<Text style={styles.titleText} numberOfLines={2}>{name1}</Text>
<View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
<Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble1?'red':'white'}}>{price1}</Text>
... ... @@ -203,7 +212,7 @@ export default class RedPersonPicThree extends Component{
</TouchableOpacity>
<TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} >
<YH_Image url={backgroundImage2} style={[styles.image,{resizeMode: 'contain'}]}/>
{linkType2=='1'?<View style={styles.maskContainer1}>
{linkType2=='1' && showProductInfo2?<View style={styles.maskContainer1}>
<Text style={styles.titleText} numberOfLines={2}>{name2}</Text>
<View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
<Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble2?'red':'white'}}>{price2}</Text>
... ... @@ -214,7 +223,7 @@ export default class RedPersonPicThree extends Component{
</View>
<TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.imageBig} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} >
<YH_Image url={backgroundImage3} style={[styles.imageBig,{resizeMode: 'contain'}]}/>
{linkType3=='1'?<View style={styles.maskContainer2}>
{linkType3=='1' && showProductInfo3?<View style={styles.maskContainer2}>
<Text style={styles.titleText} numberOfLines={2}>{name3}</Text>
<View style={{backgroundColor: 'transparent',flexDirection: 'row'}}>
<Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble3?'red':'white'}}>{price3}</Text>
... ... @@ -231,7 +240,7 @@ export default class RedPersonPicThree extends Component{
<TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} >
<View style={styles.subContainer}>
<YH_Image url={backgroundImage1} style={[styles.imageBig,{resizeMode: 'contain'}]}/>
{linkType1=='1'?<View style={styles.maskContainer2}>
{linkType1=='1' && showProductInfo1?<View style={styles.maskContainer2}>
<Text style={styles.titleText} numberOfLines={2}>{name1}</Text>
<View style={{backgroundColor: 'transparent',flexDirection: 'row'}}>
<Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble1?'red':'white'}}>{price1}</Text>
... ... @@ -243,7 +252,7 @@ export default class RedPersonPicThree extends Component{
<View style={styles.subContainer}>
<TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} >
<YH_Image url={backgroundImage2} style={[styles.image,{resizeMode: 'contain'}]}/>
{linkType2=='1'?<View style={styles.maskContainer1}>
{linkType2=='1' && showProductInfo2?<View style={styles.maskContainer1}>
<Text style={styles.titleText} numberOfLines={2}>{name2}</Text>
<View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
<Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble2?'red':'white'}}>{price2}</Text>
... ... @@ -253,7 +262,7 @@ export default class RedPersonPicThree extends Component{
</TouchableOpacity>
<TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} >
<YH_Image url={backgroundImage3} style={[styles.image,{resizeMode: 'contain'}]}/>
{linkType3=='1'?<View style={styles.maskContainer1}>
{linkType3=='1' && showProductInfo3?<View style={styles.maskContainer1}>
<Text style={styles.titleText} numberOfLines={2}>{name3}</Text>
<View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
<Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble3?'red':'white'}}>{price3}</Text>
... ...