|
|
import React, {Component } from 'react'
|
|
|
import { Image ,View, StyleSheet, Text, Dimensions} from 'react-native';
|
|
|
import { Image ,View, StyleSheet, Text, Dimensions,TouchableOpacity} from 'react-native';
|
|
|
import Immutable, {Map} from 'immutable';
|
|
|
|
|
|
export default class RedPersonPicThree extends Component{
|
...
|
...
|
@@ -37,6 +37,7 @@ export default class RedPersonPicThree extends Component{ |
|
|
let price1 = '¥' + salePrice1.toFixed(2);
|
|
|
let sale1 = '¥' + originPrice1.toFixed(2);
|
|
|
let saleAble1 = salePrice1>0?true:false;
|
|
|
let linkReource1 = data1.resource;
|
|
|
|
|
|
let data2 = list?list[1]:null;
|
|
|
let backgroundImage2 = data2.pic;
|
...
|
...
|
@@ -48,6 +49,7 @@ export default class RedPersonPicThree extends Component{ |
|
|
let price2 = '¥' + salePrice2.toFixed(2);
|
|
|
let sale2 = '¥' + originPrice2.toFixed(2);
|
|
|
let saleAble2 = salePrice2>0?true:false;
|
|
|
let linkReource2 = data2.resource;
|
|
|
|
|
|
let data3 = list?list[2]:null;
|
|
|
let backgroundImage3 = data3.pic;
|
...
|
...
|
@@ -59,50 +61,63 @@ export default class RedPersonPicThree extends Component{ |
|
|
let price3 = '¥' + salePrice3.toFixed(2);
|
|
|
let sale3 = '¥' + originPrice3.toFixed(2);
|
|
|
let saleAble3 = salePrice3>0?true:false;
|
|
|
let linkReource3 = data3.resource;
|
|
|
|
|
|
switch (displayType) {
|
|
|
case '1':
|
|
|
return (
|
|
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth4+nullHeigth:containerHeigth4,backgroundColor: 'white'}}>
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.imagetype4}>
|
|
|
{saleAble1?<View style={styles.maskContainer4}>
|
|
|
<Text numberOfLines={1} style={styles.titleText4}>{name1}</Text>
|
|
|
<Text style={styles.price4}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.imagetype4}>
|
|
|
{saleAble2?<View style={styles.maskContainer4}>
|
|
|
<Text numberOfLines={1} style={styles.titleText4}>{name2}</Text>
|
|
|
<Text style={styles.price4}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.imagetype4}>
|
|
|
{saleAble3?<View style={styles.maskContainer4}>
|
|
|
<Text numberOfLines={1} style={styles.titleText4}>{name3}</Text>
|
|
|
<Text style={styles.price4}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.imagetype4}>
|
|
|
{saleAble1?<View style={styles.maskContainer4}>
|
|
|
<Text numberOfLines={1} style={styles.titleText4}>{name1}</Text>
|
|
|
<Text style={styles.price4}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.imagetype4}>
|
|
|
{saleAble2?<View style={styles.maskContainer4}>
|
|
|
<Text numberOfLines={1} style={styles.titleText4}>{name2}</Text>
|
|
|
<Text style={styles.price4}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.imagetype4}>
|
|
|
{saleAble3?<View style={styles.maskContainer4}>
|
|
|
<Text numberOfLines={1} style={styles.titleText4}>{name3}</Text>
|
|
|
<Text style={styles.price4}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
)
|
|
|
break;
|
|
|
case '2':
|
|
|
return (
|
|
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth3+nullHeigth:containerHeigth3,backgroundColor: 'white'}}>
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.imagetype3}>
|
|
|
{saleAble1?<View style={styles.maskContainer3}>
|
|
|
<Text style={styles.price3}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.imagetype3}>
|
|
|
{saleAble2?<View style={styles.maskContainer3}>
|
|
|
<Text style={styles.price3}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.imagetype3}>
|
|
|
{saleAble3?<View style={styles.maskContainer3}>
|
|
|
<Text style={styles.price3}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<TouchableOpacity style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.imagetype3}>
|
|
|
{saleAble1?<View style={styles.maskContainer3}>
|
|
|
<Text style={styles.price3}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.imagetype3}>
|
|
|
{saleAble2?<View style={styles.maskContainer3}>
|
|
|
<Text style={styles.price3}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.imagetype3}>
|
|
|
{saleAble3?<View style={styles.maskContainer3}>
|
|
|
<Text style={styles.price3}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
)
|
|
|
break;
|
...
|
...
|
@@ -110,53 +125,64 @@ export default class RedPersonPicThree extends Component{ |
|
|
return (
|
|
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth+nullHeigth:containerHeigth,backgroundColor: 'white'}}>
|
|
|
<View style={styles.subContainer}>
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.image}>
|
|
|
{saleAble1?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
<Text style={styles.price}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
{saleAble2?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
<Text style={styles.price}>{price2}</Text>
|
|
|
<TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.image}>
|
|
|
{saleAble1?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
<Text style={styles.price}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
{saleAble2?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
<Text style={styles.price}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
<TouchableOpacity style={styles.imageBig} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.imageBig}>
|
|
|
{saleAble3?<View style={styles.maskContainer2}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
|
|
<Text style={styles.price}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</View>
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.imageBig}>
|
|
|
{saleAble3?<View style={styles.maskContainer2}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
|
|
<Text style={styles.price}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
)
|
|
|
break;
|
|
|
case '4':
|
|
|
return (
|
|
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth+nullHeigth:containerHeigth,backgroundColor: 'white'}}>
|
|
|
<TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
<View style={styles.subContainer}>
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.imageBig}>
|
|
|
{saleAble1?<View style={styles.maskContainer2}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
<Text style={styles.price}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
<View style={styles.subContainer}>
|
|
|
<Image source={{uri: backgroundImage1}} style={styles.imageBig}>
|
|
|
{saleAble1?<View style={styles.maskContainer2}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
<Text style={styles.price}>{price1}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</View>
|
|
|
<View style={styles.subContainer}>
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
{saleAble2?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
<Text style={styles.price}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
<TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
<Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
{saleAble2?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
<Text style={styles.price}>{price2}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
<Image source={{uri: backgroundImage3}} style={styles.image}>
|
|
|
{saleAble3?<View style={styles.maskContainer1}>
|
|
|
<Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
|
|
<Text style={styles.price}>{price3}</Text>
|
|
|
</View>:null}
|
|
|
</Image>
|
|
|
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
</View>
|
|
|
)
|
...
|
...
|
|