1
|
import React, {Component } from 'react'
|
1
|
import React, {Component } from 'react'
|
2
|
-import { Image ,View, StyleSheet, Text, Dimensions} from 'react-native';
|
2
|
+import { Image ,View, StyleSheet, Text, Dimensions,TouchableOpacity} from 'react-native';
|
3
|
import Immutable, {Map} from 'immutable';
|
3
|
import Immutable, {Map} from 'immutable';
|
4
|
|
4
|
|
5
|
export default class RedPersonPicThree extends Component{
|
5
|
export default class RedPersonPicThree extends Component{
|
|
@@ -37,6 +37,7 @@ export default class RedPersonPicThree extends Component{ |
|
@@ -37,6 +37,7 @@ export default class RedPersonPicThree extends Component{ |
37
|
let price1 = '¥' + salePrice1.toFixed(2);
|
37
|
let price1 = '¥' + salePrice1.toFixed(2);
|
38
|
let sale1 = '¥' + originPrice1.toFixed(2);
|
38
|
let sale1 = '¥' + originPrice1.toFixed(2);
|
39
|
let saleAble1 = salePrice1>0?true:false;
|
39
|
let saleAble1 = salePrice1>0?true:false;
|
|
|
40
|
+ let linkReource1 = data1.resource;
|
40
|
|
41
|
|
41
|
let data2 = list?list[1]:null;
|
42
|
let data2 = list?list[1]:null;
|
42
|
let backgroundImage2 = data2.pic;
|
43
|
let backgroundImage2 = data2.pic;
|
|
@@ -48,6 +49,7 @@ export default class RedPersonPicThree extends Component{ |
|
@@ -48,6 +49,7 @@ export default class RedPersonPicThree extends Component{ |
48
|
let price2 = '¥' + salePrice2.toFixed(2);
|
49
|
let price2 = '¥' + salePrice2.toFixed(2);
|
49
|
let sale2 = '¥' + originPrice2.toFixed(2);
|
50
|
let sale2 = '¥' + originPrice2.toFixed(2);
|
50
|
let saleAble2 = salePrice2>0?true:false;
|
51
|
let saleAble2 = salePrice2>0?true:false;
|
|
|
52
|
+ let linkReource2 = data2.resource;
|
51
|
|
53
|
|
52
|
let data3 = list?list[2]:null;
|
54
|
let data3 = list?list[2]:null;
|
53
|
let backgroundImage3 = data3.pic;
|
55
|
let backgroundImage3 = data3.pic;
|
|
@@ -59,50 +61,63 @@ export default class RedPersonPicThree extends Component{ |
|
@@ -59,50 +61,63 @@ export default class RedPersonPicThree extends Component{ |
59
|
let price3 = '¥' + salePrice3.toFixed(2);
|
61
|
let price3 = '¥' + salePrice3.toFixed(2);
|
60
|
let sale3 = '¥' + originPrice3.toFixed(2);
|
62
|
let sale3 = '¥' + originPrice3.toFixed(2);
|
61
|
let saleAble3 = salePrice3>0?true:false;
|
63
|
let saleAble3 = salePrice3>0?true:false;
|
|
|
64
|
+ let linkReource3 = data3.resource;
|
62
|
|
65
|
|
63
|
switch (displayType) {
|
66
|
switch (displayType) {
|
64
|
case '1':
|
67
|
case '1':
|
65
|
return (
|
68
|
return (
|
66
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth4+nullHeigth:containerHeigth4,backgroundColor: 'white'}}>
|
69
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth4+nullHeigth:containerHeigth4,backgroundColor: 'white'}}>
|
67
|
- <Image source={{uri: backgroundImage1}} style={styles.imagetype4}>
|
|
|
68
|
- {saleAble1?<View style={styles.maskContainer4}>
|
|
|
69
|
- <Text numberOfLines={1} style={styles.titleText4}>{name1}</Text>
|
|
|
70
|
- <Text style={styles.price4}>{price1}</Text>
|
|
|
71
|
- </View>:null}
|
|
|
72
|
- </Image>
|
|
|
73
|
- <Image source={{uri: backgroundImage2}} style={styles.imagetype4}>
|
|
|
74
|
- {saleAble2?<View style={styles.maskContainer4}>
|
|
|
75
|
- <Text numberOfLines={1} style={styles.titleText4}>{name2}</Text>
|
|
|
76
|
- <Text style={styles.price4}>{price2}</Text>
|
|
|
77
|
- </View>:null}
|
|
|
78
|
- </Image>
|
|
|
79
|
- <Image source={{uri: backgroundImage3}} style={styles.imagetype4}>
|
|
|
80
|
- {saleAble3?<View style={styles.maskContainer4}>
|
|
|
81
|
- <Text numberOfLines={1} style={styles.titleText4}>{name3}</Text>
|
|
|
82
|
- <Text style={styles.price4}>{price3}</Text>
|
|
|
83
|
- </View>:null}
|
|
|
84
|
- </Image>
|
70
|
+ <TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
71
|
+ <Image source={{uri: backgroundImage1}} style={styles.imagetype4}>
|
|
|
72
|
+ {saleAble1?<View style={styles.maskContainer4}>
|
|
|
73
|
+ <Text numberOfLines={1} style={styles.titleText4}>{name1}</Text>
|
|
|
74
|
+ <Text style={styles.price4}>{price1}</Text>
|
|
|
75
|
+ </View>:null}
|
|
|
76
|
+ </Image>
|
|
|
77
|
+ </TouchableOpacity>
|
|
|
78
|
+ <TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
79
|
+ <Image source={{uri: backgroundImage2}} style={styles.imagetype4}>
|
|
|
80
|
+ {saleAble2?<View style={styles.maskContainer4}>
|
|
|
81
|
+ <Text numberOfLines={1} style={styles.titleText4}>{name2}</Text>
|
|
|
82
|
+ <Text style={styles.price4}>{price2}</Text>
|
|
|
83
|
+ </View>:null}
|
|
|
84
|
+ </Image>
|
|
|
85
|
+ </TouchableOpacity>
|
|
|
86
|
+ <TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
87
|
+ <Image source={{uri: backgroundImage3}} style={styles.imagetype4}>
|
|
|
88
|
+ {saleAble3?<View style={styles.maskContainer4}>
|
|
|
89
|
+ <Text numberOfLines={1} style={styles.titleText4}>{name3}</Text>
|
|
|
90
|
+ <Text style={styles.price4}>{price3}</Text>
|
|
|
91
|
+ </View>:null}
|
|
|
92
|
+ </Image>
|
|
|
93
|
+ </TouchableOpacity>
|
85
|
</View>
|
94
|
</View>
|
86
|
)
|
95
|
)
|
87
|
break;
|
96
|
break;
|
88
|
case '2':
|
97
|
case '2':
|
89
|
return (
|
98
|
return (
|
90
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth3+nullHeigth:containerHeigth3,backgroundColor: 'white'}}>
|
99
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth3+nullHeigth:containerHeigth3,backgroundColor: 'white'}}>
|
91
|
- <Image source={{uri: backgroundImage1}} style={styles.imagetype3}>
|
|
|
92
|
- {saleAble1?<View style={styles.maskContainer3}>
|
|
|
93
|
- <Text style={styles.price3}>{price1}</Text>
|
|
|
94
|
- </View>:null}
|
|
|
95
|
- </Image>
|
|
|
96
|
- <Image source={{uri: backgroundImage2}} style={styles.imagetype3}>
|
|
|
97
|
- {saleAble2?<View style={styles.maskContainer3}>
|
|
|
98
|
- <Text style={styles.price3}>{price2}</Text>
|
|
|
99
|
- </View>:null}
|
|
|
100
|
- </Image>
|
|
|
101
|
- <Image source={{uri: backgroundImage3}} style={styles.imagetype3}>
|
|
|
102
|
- {saleAble3?<View style={styles.maskContainer3}>
|
|
|
103
|
- <Text style={styles.price3}>{price3}</Text>
|
|
|
104
|
- </View>:null}
|
|
|
105
|
- </Image>
|
100
|
+ <TouchableOpacity style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
101
|
+ <Image source={{uri: backgroundImage1}} style={styles.imagetype3}>
|
|
|
102
|
+ {saleAble1?<View style={styles.maskContainer3}>
|
|
|
103
|
+ <Text style={styles.price3}>{price1}</Text>
|
|
|
104
|
+ </View>:null}
|
|
|
105
|
+ </Image>
|
|
|
106
|
+ </TouchableOpacity>
|
|
|
107
|
+ <TouchableOpacity style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
108
|
+ <Image source={{uri: backgroundImage2}} style={styles.imagetype3}>
|
|
|
109
|
+ {saleAble2?<View style={styles.maskContainer3}>
|
|
|
110
|
+ <Text style={styles.price3}>{price2}</Text>
|
|
|
111
|
+ </View>:null}
|
|
|
112
|
+ </Image>
|
|
|
113
|
+ </TouchableOpacity>
|
|
|
114
|
+ <TouchableOpacity style={styles.imagetype3} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
115
|
+ <Image source={{uri: backgroundImage3}} style={styles.imagetype3}>
|
|
|
116
|
+ {saleAble3?<View style={styles.maskContainer3}>
|
|
|
117
|
+ <Text style={styles.price3}>{price3}</Text>
|
|
|
118
|
+ </View>:null}
|
|
|
119
|
+ </Image>
|
|
|
120
|
+ </TouchableOpacity>
|
106
|
</View>
|
121
|
</View>
|
107
|
)
|
122
|
)
|
108
|
break;
|
123
|
break;
|
|
@@ -110,53 +125,64 @@ export default class RedPersonPicThree extends Component{ |
|
@@ -110,53 +125,64 @@ export default class RedPersonPicThree extends Component{ |
110
|
return (
|
125
|
return (
|
111
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth+nullHeigth:containerHeigth,backgroundColor: 'white'}}>
|
126
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth+nullHeigth:containerHeigth,backgroundColor: 'white'}}>
|
112
|
<View style={styles.subContainer}>
|
127
|
<View style={styles.subContainer}>
|
113
|
- <Image source={{uri: backgroundImage1}} style={styles.image}>
|
|
|
114
|
- {saleAble1?<View style={styles.maskContainer1}>
|
|
|
115
|
- <Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
116
|
- <Text style={styles.price}>{price1}</Text>
|
|
|
117
|
- </View>:null}
|
|
|
118
|
- </Image>
|
|
|
119
|
- <Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
120
|
- {saleAble2?<View style={styles.maskContainer1}>
|
|
|
121
|
- <Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
122
|
- <Text style={styles.price}>{price2}</Text>
|
128
|
+ <TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
129
|
+ <Image source={{uri: backgroundImage1}} style={styles.image}>
|
|
|
130
|
+ {saleAble1?<View style={styles.maskContainer1}>
|
|
|
131
|
+ <Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
132
|
+ <Text style={styles.price}>{price1}</Text>
|
|
|
133
|
+ </View>:null}
|
|
|
134
|
+ </Image>
|
|
|
135
|
+ </TouchableOpacity>
|
|
|
136
|
+ <TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
137
|
+ <Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
138
|
+ {saleAble2?<View style={styles.maskContainer1}>
|
|
|
139
|
+ <Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
140
|
+ <Text style={styles.price}>{price2}</Text>
|
|
|
141
|
+ </View>:null}
|
|
|
142
|
+ </Image>
|
|
|
143
|
+ </TouchableOpacity>
|
|
|
144
|
+ </View>
|
|
|
145
|
+ <TouchableOpacity style={styles.imageBig} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
|
|
146
|
+ <Image source={{uri: backgroundImage3}} style={styles.imageBig}>
|
|
|
147
|
+ {saleAble3?<View style={styles.maskContainer2}>
|
|
|
148
|
+ <Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
|
|
149
|
+ <Text style={styles.price}>{price3}</Text>
|
123
|
</View>:null}
|
150
|
</View>:null}
|
124
|
</Image>
|
151
|
</Image>
|
125
|
- </View>
|
|
|
126
|
- <Image source={{uri: backgroundImage3}} style={styles.imageBig}>
|
|
|
127
|
- {saleAble3?<View style={styles.maskContainer2}>
|
|
|
128
|
- <Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
|
|
129
|
- <Text style={styles.price}>{price3}</Text>
|
|
|
130
|
- </View>:null}
|
|
|
131
|
- </Image>
|
152
|
+ </TouchableOpacity>
|
132
|
</View>
|
153
|
</View>
|
133
|
)
|
154
|
)
|
134
|
break;
|
155
|
break;
|
135
|
case '4':
|
156
|
case '4':
|
136
|
return (
|
157
|
return (
|
137
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth+nullHeigth:containerHeigth,backgroundColor: 'white'}}>
|
158
|
<View style={{flexDirection: 'row',width:width,height: isModuleMargin=='1'?containerHeigth+nullHeigth:containerHeigth,backgroundColor: 'white'}}>
|
|
|
159
|
+ <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
|
|
|
160
|
+ <View style={styles.subContainer}>
|
|
|
161
|
+ <Image source={{uri: backgroundImage1}} style={styles.imageBig}>
|
|
|
162
|
+ {saleAble1?<View style={styles.maskContainer2}>
|
|
|
163
|
+ <Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
164
|
+ <Text style={styles.price}>{price1}</Text>
|
|
|
165
|
+ </View>:null}
|
|
|
166
|
+ </Image>
|
|
|
167
|
+ </View>
|
|
|
168
|
+ </TouchableOpacity>
|
138
|
<View style={styles.subContainer}>
|
169
|
<View style={styles.subContainer}>
|
139
|
- <Image source={{uri: backgroundImage1}} style={styles.imageBig}>
|
|
|
140
|
- {saleAble1?<View style={styles.maskContainer2}>
|
|
|
141
|
- <Text numberOfLines={2} style={styles.titleText}>{name1}</Text>
|
|
|
142
|
- <Text style={styles.price}>{price1}</Text>
|
|
|
143
|
- </View>:null}
|
|
|
144
|
- </Image>
|
|
|
145
|
- </View>
|
|
|
146
|
- <View style={styles.subContainer}>
|
|
|
147
|
- <Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
148
|
- {saleAble2?<View style={styles.maskContainer1}>
|
|
|
149
|
- <Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
150
|
- <Text style={styles.price}>{price2}</Text>
|
|
|
151
|
- </View>:null}
|
|
|
152
|
- </Image>
|
170
|
+ <TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
|
|
|
171
|
+ <Image source={{uri: backgroundImage2}} style={styles.image}>
|
|
|
172
|
+ {saleAble2?<View style={styles.maskContainer1}>
|
|
|
173
|
+ <Text numberOfLines={2} style={styles.titleText}>{name2}</Text>
|
|
|
174
|
+ <Text style={styles.price}>{price2}</Text>
|
|
|
175
|
+ </View>:null}
|
|
|
176
|
+ </Image>
|
|
|
177
|
+ </TouchableOpacity>
|
|
|
178
|
+ <TouchableOpacity style={styles.image} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
|
153
|
<Image source={{uri: backgroundImage3}} style={styles.image}>
|
179
|
<Image source={{uri: backgroundImage3}} style={styles.image}>
|
154
|
{saleAble3?<View style={styles.maskContainer1}>
|
180
|
{saleAble3?<View style={styles.maskContainer1}>
|
155
|
<Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
181
|
<Text numberOfLines={2} style={styles.titleText}>{name3}</Text>
|
156
|
<Text style={styles.price}>{price3}</Text>
|
182
|
<Text style={styles.price}>{price3}</Text>
|
157
|
</View>:null}
|
183
|
</View>:null}
|
158
|
</Image>
|
184
|
</Image>
|
159
|
-
|
185
|
+ </TouchableOpacity>
|
160
|
</View>
|
186
|
</View>
|
161
|
</View>
|
187
|
</View>
|
162
|
)
|
188
|
)
|