Authored by 张丽霞

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

@@ -45,6 +45,9 @@ export default class DoubleImage extends React.Component { @@ -45,6 +45,9 @@ export default class DoubleImage extends React.Component {
45 let linkType1 = data1.linkType; 45 let linkType1 = data1.linkType;
46 let showProductInfo1 = data1.showProductInfo; 46 let showProductInfo1 = data1.showProductInfo;
47 let product1 = data1.product; 47 let product1 = data1.product;
  48 + if (!product1) {
  49 + showProductInfo1 = false;
  50 + }
48 let salePrice1 = product1?parseFloat(product1.sales_price):0; 51 let salePrice1 = product1?parseFloat(product1.sales_price):0;
49 let originPrice1 = product1?parseFloat(product1.market_price):0; 52 let originPrice1 = product1?parseFloat(product1.market_price):0;
50 let name1 = product1?product1.product_name:''; 53 let name1 = product1?product1.product_name:'';
@@ -58,6 +61,9 @@ export default class DoubleImage extends React.Component { @@ -58,6 +61,9 @@ export default class DoubleImage extends React.Component {
58 let linkType2 = data2.linkType; 61 let linkType2 = data2.linkType;
59 let showProductInfo2 = data2.showProductInfo; 62 let showProductInfo2 = data2.showProductInfo;
60 let product2 = data2.product; 63 let product2 = data2.product;
  64 + if (!product2) {
  65 + showProductInfo2 = false;
  66 + }
61 let salePrice2 = product2?parseFloat(product2.sales_price):0; 67 let salePrice2 = product2?parseFloat(product2.sales_price):0;
62 let originPrice2 = product2?parseFloat(product2.market_price):0; 68 let originPrice2 = product2?parseFloat(product2.market_price):0;
63 let name2 = product2?product2.product_name:''; 69 let name2 = product2?product2.product_name:'';
@@ -49,6 +49,9 @@ export default class SingleImage extends React.Component { @@ -49,6 +49,9 @@ export default class SingleImage extends React.Component {
49 let imageHeight = (imageH*width)/(imageW==0?1:imageW);//根据返回信息计算出高度 49 let imageHeight = (imageH*width)/(imageW==0?1:imageW);//根据返回信息计算出高度
50 let backgroundHeight =isModuleMargin=='1'?(imageHeight+10):imageHeight; 50 let backgroundHeight =isModuleMargin=='1'?(imageHeight+10):imageHeight;
51 let product = data.product; 51 let product = data.product;
  52 + if (!product) {
  53 + showProductInfo = false;
  54 + }
52 let salePrice = product?parseFloat(product.sales_price):0; 55 let salePrice = product?parseFloat(product.sales_price):0;
53 let originPrice = product?parseFloat(product.market_price):0; 56 let originPrice = product?parseFloat(product.market_price):0;
54 let name = product?product.product_name:''; 57 let name = product?product.product_name:'';
@@ -33,6 +33,9 @@ export default class RedPersonPicThree extends Component{ @@ -33,6 +33,9 @@ export default class RedPersonPicThree extends Component{
33 let linkType1 = data1.linkType; 33 let linkType1 = data1.linkType;
34 let showProductInfo1 = data1.showProductInfo; 34 let showProductInfo1 = data1.showProductInfo;
35 let product1 = data1.product; 35 let product1 = data1.product;
  36 + if (!product1) {
  37 + showProductInfo1 = false;
  38 + }
36 let salePrice1 = product1?parseFloat(product1.sales_price):0; 39 let salePrice1 = product1?parseFloat(product1.sales_price):0;
37 let originPrice1 = product1?parseFloat(product1.market_price):0; 40 let originPrice1 = product1?parseFloat(product1.market_price):0;
38 let name1 = product1?product1.product_name:''; 41 let name1 = product1?product1.product_name:'';
@@ -46,6 +49,9 @@ export default class RedPersonPicThree extends Component{ @@ -46,6 +49,9 @@ export default class RedPersonPicThree extends Component{
46 let linkType2 = data2.linkType; 49 let linkType2 = data2.linkType;
47 let showProductInfo2 = data2.showProductInfo; 50 let showProductInfo2 = data2.showProductInfo;
48 let product2 = data2.product; 51 let product2 = data2.product;
  52 + if (!product2) {
  53 + showProductInfo2 = false;
  54 + }
49 let salePrice2 = product2?parseFloat(product2.sales_price):0; 55 let salePrice2 = product2?parseFloat(product2.sales_price):0;
50 let originPrice2 = product2?parseFloat(product2.market_price):0; 56 let originPrice2 = product2?parseFloat(product2.market_price):0;
51 let name2 = product2?product2.product_name:''; 57 let name2 = product2?product2.product_name:'';
@@ -59,6 +65,9 @@ export default class RedPersonPicThree extends Component{ @@ -59,6 +65,9 @@ export default class RedPersonPicThree extends Component{
59 let linkType3 = data3.linkType; 65 let linkType3 = data3.linkType;
60 let showProductInfo3 = data3.showProductInfo; 66 let showProductInfo3 = data3.showProductInfo;
61 let product3 = data3.product; 67 let product3 = data3.product;
  68 + if (!product3) {
  69 + showProductInfo3 = false;
  70 + }
62 let salePrice3 = product3?parseFloat(product3.sales_price):0; 71 let salePrice3 = product3?parseFloat(product3.sales_price):0;
63 let originPrice3= product3?parseFloat(product3.market_price):0; 72 let originPrice3= product3?parseFloat(product3.market_price):0;
64 let name3 = product3?product3.product_name:''; 73 let name3 = product3?product3.product_name:'';
@@ -165,21 +174,21 @@ export default class RedPersonPicThree extends Component{ @@ -165,21 +174,21 @@ export default class RedPersonPicThree extends Component{
165 <View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth3+nullHeigth:containerHeigth3,backgroundColor: '#f0f0f0'}}> 174 <View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth3+nullHeigth:containerHeigth3,backgroundColor: '#f0f0f0'}}>
166 <TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} > 175 <TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} >
167 <YH_Image url={backgroundImage1} style={[styles.imagetype3,{resizeMode: 'contain'}]}/> 176 <YH_Image url={backgroundImage1} style={[styles.imagetype3,{resizeMode: 'contain'}]}/>
168 - {linkType1=='1'?<View style={styles.maskContainer3}> 177 + {linkType1=='1' && showProductInfo1?<View style={styles.maskContainer3}>
169 <Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble1?'red':'white',}}>{price1}</Text> 178 <Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble1?'red':'white',}}>{price1}</Text>
170 {saleAble1?<Text style={styles.deleteSale}>{sale1}</Text>:null} 179 {saleAble1?<Text style={styles.deleteSale}>{sale1}</Text>:null}
171 </View>:null} 180 </View>:null}
172 </TouchableOpacity> 181 </TouchableOpacity>
173 <TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} > 182 <TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} >
174 <YH_Image url={backgroundImage2} style={[styles.imagetype3,{resizeMode: 'contain'}]}/> 183 <YH_Image url={backgroundImage2} style={[styles.imagetype3,{resizeMode: 'contain'}]}/>
175 - {linkType2=='1'?<View style={styles.maskContainer3}> 184 + {linkType2=='1' && showProductInfo2?<View style={styles.maskContainer3}>
176 <Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble2?'red':'white',}}>{price2}</Text> 185 <Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble2?'red':'white',}}>{price2}</Text>
177 {saleAble2?<Text style={styles.deleteSale}>{sale2}</Text>:null} 186 {saleAble2?<Text style={styles.deleteSale}>{sale2}</Text>:null}
178 </View>:null} 187 </View>:null}
179 </TouchableOpacity> 188 </TouchableOpacity>
180 <TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} > 189 <TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} >
181 <YH_Image url={backgroundImage3} style={[styles.imagetype3,{resizeMode: 'contain'}]}/> 190 <YH_Image url={backgroundImage3} style={[styles.imagetype3,{resizeMode: 'contain'}]}/>
182 - {linkType3=='1'?<View style={styles.maskContainer3}> 191 + {linkType3=='1' && showProductInfo3?<View style={styles.maskContainer3}>
183 <Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble3?'red':'white',}}>{price3}</Text> 192 <Text style={{marginTop: 2,marginLeft: 10,fontSize: 11,backgroundColor: 'transparent',color: saleAble3?'red':'white',}}>{price3}</Text>
184 {saleAble3?<Text style={styles.deleteSale}>{sale3}</Text>:null} 193 {saleAble3?<Text style={styles.deleteSale}>{sale3}</Text>:null}
185 </View>:null} 194 </View>:null}
@@ -193,7 +202,7 @@ export default class RedPersonPicThree extends Component{ @@ -193,7 +202,7 @@ export default class RedPersonPicThree extends Component{
193 <View style={styles.subContainer}> 202 <View style={styles.subContainer}>
194 <TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} > 203 <TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} >
195 <YH_Image url={backgroundImage1} style={[styles.image,{resizeMode: 'contain'}]}/> 204 <YH_Image url={backgroundImage1} style={[styles.image,{resizeMode: 'contain'}]}/>
196 - {linkType1=='1'?<View style={styles.maskContainer1}> 205 + {linkType1=='1' && showProductInfo1?<View style={styles.maskContainer1}>
197 <Text style={styles.titleText} numberOfLines={2}>{name1}</Text> 206 <Text style={styles.titleText} numberOfLines={2}>{name1}</Text>
198 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}> 207 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
199 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble1?'red':'white'}}>{price1}</Text> 208 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble1?'red':'white'}}>{price1}</Text>
@@ -203,7 +212,7 @@ export default class RedPersonPicThree extends Component{ @@ -203,7 +212,7 @@ export default class RedPersonPicThree extends Component{
203 </TouchableOpacity> 212 </TouchableOpacity>
204 <TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} > 213 <TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} >
205 <YH_Image url={backgroundImage2} style={[styles.image,{resizeMode: 'contain'}]}/> 214 <YH_Image url={backgroundImage2} style={[styles.image,{resizeMode: 'contain'}]}/>
206 - {linkType2=='1'?<View style={styles.maskContainer1}> 215 + {linkType2=='1' && showProductInfo2?<View style={styles.maskContainer1}>
207 <Text style={styles.titleText} numberOfLines={2}>{name2}</Text> 216 <Text style={styles.titleText} numberOfLines={2}>{name2}</Text>
208 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}> 217 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
209 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble2?'red':'white'}}>{price2}</Text> 218 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble2?'red':'white'}}>{price2}</Text>
@@ -214,7 +223,7 @@ export default class RedPersonPicThree extends Component{ @@ -214,7 +223,7 @@ export default class RedPersonPicThree extends Component{
214 </View> 223 </View>
215 <TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.imageBig} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} > 224 <TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.imageBig} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} >
216 <YH_Image url={backgroundImage3} style={[styles.imageBig,{resizeMode: 'contain'}]}/> 225 <YH_Image url={backgroundImage3} style={[styles.imageBig,{resizeMode: 'contain'}]}/>
217 - {linkType3=='1'?<View style={styles.maskContainer2}> 226 + {linkType3=='1' && showProductInfo3?<View style={styles.maskContainer2}>
218 <Text style={styles.titleText} numberOfLines={2}>{name3}</Text> 227 <Text style={styles.titleText} numberOfLines={2}>{name3}</Text>
219 <View style={{backgroundColor: 'transparent',flexDirection: 'row'}}> 228 <View style={{backgroundColor: 'transparent',flexDirection: 'row'}}>
220 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble3?'red':'white'}}>{price3}</Text> 229 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble3?'red':'white'}}>{price3}</Text>
@@ -231,7 +240,7 @@ export default class RedPersonPicThree extends Component{ @@ -231,7 +240,7 @@ export default class RedPersonPicThree extends Component{
231 <TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} > 240 <TouchableOpacity yh_exposureData={yh_exposureData0} activeOpacity={1.0} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1,moduleOrder,moduleType,1)}} >
232 <View style={styles.subContainer}> 241 <View style={styles.subContainer}>
233 <YH_Image url={backgroundImage1} style={[styles.imageBig,{resizeMode: 'contain'}]}/> 242 <YH_Image url={backgroundImage1} style={[styles.imageBig,{resizeMode: 'contain'}]}/>
234 - {linkType1=='1'?<View style={styles.maskContainer2}> 243 + {linkType1=='1' && showProductInfo1?<View style={styles.maskContainer2}>
235 <Text style={styles.titleText} numberOfLines={2}>{name1}</Text> 244 <Text style={styles.titleText} numberOfLines={2}>{name1}</Text>
236 <View style={{backgroundColor: 'transparent',flexDirection: 'row'}}> 245 <View style={{backgroundColor: 'transparent',flexDirection: 'row'}}>
237 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble1?'red':'white'}}>{price1}</Text> 246 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble1?'red':'white'}}>{price1}</Text>
@@ -243,7 +252,7 @@ export default class RedPersonPicThree extends Component{ @@ -243,7 +252,7 @@ export default class RedPersonPicThree extends Component{
243 <View style={styles.subContainer}> 252 <View style={styles.subContainer}>
244 <TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} > 253 <TouchableOpacity yh_exposureData={yh_exposureData1} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2,moduleOrder,moduleType,2)}} >
245 <YH_Image url={backgroundImage2} style={[styles.image,{resizeMode: 'contain'}]}/> 254 <YH_Image url={backgroundImage2} style={[styles.image,{resizeMode: 'contain'}]}/>
246 - {linkType2=='1'?<View style={styles.maskContainer1}> 255 + {linkType2=='1' && showProductInfo2?<View style={styles.maskContainer1}>
247 <Text style={styles.titleText} numberOfLines={2}>{name2}</Text> 256 <Text style={styles.titleText} numberOfLines={2}>{name2}</Text>
248 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}> 257 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
249 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble2?'red':'white'}}>{price2}</Text> 258 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble2?'red':'white'}}>{price2}</Text>
@@ -253,7 +262,7 @@ export default class RedPersonPicThree extends Component{ @@ -253,7 +262,7 @@ export default class RedPersonPicThree extends Component{
253 </TouchableOpacity> 262 </TouchableOpacity>
254 <TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} > 263 <TouchableOpacity yh_exposureData={yh_exposureData2} activeOpacity={1.0} style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3,moduleOrder,moduleType,3)}} >
255 <YH_Image url={backgroundImage3} style={[styles.image,{resizeMode: 'contain'}]}/> 264 <YH_Image url={backgroundImage3} style={[styles.image,{resizeMode: 'contain'}]}/>
256 - {linkType3=='1'?<View style={styles.maskContainer1}> 265 + {linkType3=='1' && showProductInfo3?<View style={styles.maskContainer1}>
257 <Text style={styles.titleText} numberOfLines={2}>{name3}</Text> 266 <Text style={styles.titleText} numberOfLines={2}>{name3}</Text>
258 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}> 267 <View style={{backgroundColor: 'transparent',flexDirection: 'row',marginRight: 10}}>
259 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble3?'red':'white'}}>{price3}</Text> 268 <Text style={{fontSize: 12,backgroundColor: 'transparent',color: saleAble3?'red':'white'}}>{price3}</Text>