Showing
7 changed files
with
113 additions
and
21 deletions
| @@ -5,7 +5,9 @@ import { | @@ -5,7 +5,9 @@ import { | ||
| 5 | View, | 5 | View, |
| 6 | Image, | 6 | Image, |
| 7 | Dimensions, | 7 | Dimensions, |
| 8 | - ScrollView | 8 | + ScrollView, |
| 9 | + Text, | ||
| 10 | + TouchableOpacity, | ||
| 9 | } from "react-native"; | 11 | } from "react-native"; |
| 10 | import { StackNavigator, TabNavigator } from "react-navigation"; | 12 | import { StackNavigator, TabNavigator } from "react-navigation"; |
| 11 | 13 | ||
| @@ -16,17 +18,20 @@ export default class CommonImageView extends Component { | @@ -16,17 +18,20 @@ export default class CommonImageView extends Component { | ||
| 16 | products: [ | 18 | products: [ |
| 17 | { | 19 | { |
| 18 | headerImage: require("../assets/home/product_header_1.jpg"), | 20 | headerImage: require("../assets/home/product_header_1.jpg"), |
| 19 | - title: "", | 21 | + title: "平安e生保2017版-100万(有社保含新农合)", |
| 20 | - subscribe: "", | 22 | + subscribe: "200万医疗险/续保至99岁免审核", |
| 21 | - price: "" | 23 | + price: "¥174.00", |
| 22 | - },{ | 24 | + detailImage: "", |
| 25 | + }, | ||
| 26 | + { | ||
| 23 | headerImage: require("../assets/home/product_header_2.jpg"), | 27 | headerImage: require("../assets/home/product_header_2.jpg"), |
| 24 | - title: "", | 28 | + title: "泰康在线“住院宝”必备版(0-49周岁)", |
| 25 | - subscribe: "", | 29 | + subscribe: "承保疾病,意外伤害,性价比高,住院有补贴,30-49岁一家三口可买", |
| 26 | - price: "", | 30 | + price: "¥249.00", |
| 31 | + detailImage: "", | ||
| 27 | } | 32 | } |
| 28 | ] | 33 | ] |
| 29 | - } | 34 | + }; |
| 30 | } | 35 | } |
| 31 | render() { | 36 | render() { |
| 32 | console.log("Image index", this.props.navigation.state.params.index); | 37 | console.log("Image index", this.props.navigation.state.params.index); |
| @@ -34,8 +39,26 @@ export default class CommonImageView extends Component { | @@ -34,8 +39,26 @@ export default class CommonImageView extends Component { | ||
| 34 | const item = this.state.products[index]; | 39 | const item = this.state.products[index]; |
| 35 | return ( | 40 | return ( |
| 36 | <View style={styles.container}> | 41 | <View style={styles.container}> |
| 37 | - <ScrollView> | 42 | + <ScrollView style={styles.scrollViewContainer}> |
| 38 | - | 43 | + <View style={styles.headerContainer}> |
| 44 | + {/* 顶部图片 */} | ||
| 45 | + <Image | ||
| 46 | + style={styles.headerImage} | ||
| 47 | + resizeMode="contain" | ||
| 48 | + source={item.headerImage} | ||
| 49 | + /> | ||
| 50 | + {/* 标题 */} | ||
| 51 | + <View style={styles.titleContainer}> | ||
| 52 | + <Text style={styles.title}>{item.title}</Text> | ||
| 53 | + <Text style={styles.subscribe}>{item.subscribe}</Text> | ||
| 54 | + </View> | ||
| 55 | + </View> | ||
| 56 | + {/* 产品特色 */} | ||
| 57 | + <View style={styles.midContaier}> | ||
| 58 | + <Image source={require("../assets/home/ic_feature.png")} style={{width: 16, height: 17,}} /> | ||
| 59 | + <Text style={styles.midText}>产品特色</Text> | ||
| 60 | + </View> | ||
| 61 | + {/* 图片详情 */} | ||
| 39 | {index == 0 ? ( | 62 | {index == 0 ? ( |
| 40 | <Image | 63 | <Image |
| 41 | style={styles.imgOne} | 64 | style={styles.imgOne} |
| @@ -50,6 +73,15 @@ export default class CommonImageView extends Component { | @@ -50,6 +73,15 @@ export default class CommonImageView extends Component { | ||
| 50 | /> | 73 | /> |
| 51 | )} | 74 | )} |
| 52 | </ScrollView> | 75 | </ScrollView> |
| 76 | + {/* 悬浮按钮 */} | ||
| 77 | + <View style={styles.footer}> | ||
| 78 | + <View style={styles.footerLeft}> | ||
| 79 | + <Text style={styles.price}>{item.price}</Text> | ||
| 80 | + </View> | ||
| 81 | + <TouchableOpacity style={styles.footerRight}> | ||
| 82 | + <Text style={styles.button}>立即投保</Text> | ||
| 83 | + </TouchableOpacity> | ||
| 84 | + </View> | ||
| 53 | </View> | 85 | </View> |
| 54 | ); | 86 | ); |
| 55 | } | 87 | } |
| @@ -57,15 +89,81 @@ export default class CommonImageView extends Component { | @@ -57,15 +89,81 @@ export default class CommonImageView extends Component { | ||
| 57 | 89 | ||
| 58 | const styles = StyleSheet.create({ | 90 | const styles = StyleSheet.create({ |
| 59 | container: { | 91 | container: { |
| 92 | + flex: 1, | ||
| 60 | justifyContent: "flex-start", | 93 | justifyContent: "flex-start", |
| 61 | - backgroundColor: "#EFEFEF", | 94 | + backgroundColor: "#EFEFEF" |
| 95 | + }, | ||
| 96 | + scrollViewContainer: {}, | ||
| 97 | + headerContainer: {}, | ||
| 98 | + headerImage: { | ||
| 99 | + width: Dimensions.get("window").width, | ||
| 100 | + height: Dimensions.get("window").width * 300 / 750 | ||
| 101 | + }, | ||
| 102 | + titleContainer: { | ||
| 103 | + backgroundColor: "white", | ||
| 104 | + paddingLeft: 15, | ||
| 105 | + paddingRight: 15, | ||
| 106 | + paddingTop: 10, | ||
| 107 | + paddingBottom: 10, | ||
| 108 | + }, | ||
| 109 | + title: { | ||
| 110 | + fontSize: 16, | ||
| 111 | + color: "#242424", | ||
| 112 | + lineHeight: 22 | ||
| 113 | + }, | ||
| 114 | + subscribe: { | ||
| 115 | + fontSize: 13, | ||
| 116 | + color: "#7A7A7A", | ||
| 117 | + lineHeight: 15 | ||
| 118 | + }, | ||
| 119 | + midContaier: { | ||
| 120 | + marginTop: 10, | ||
| 121 | + height: 45, | ||
| 122 | + backgroundColor: "white", | ||
| 123 | + flexDirection: "row", | ||
| 124 | + paddingLeft: 13, | ||
| 125 | + alignItems: "center", | ||
| 126 | + }, | ||
| 127 | + midText: { | ||
| 128 | + marginLeft: 10, | ||
| 129 | + fontSize: 15, | ||
| 130 | + color: "#242424", | ||
| 62 | }, | 131 | }, |
| 63 | imgOne: { | 132 | imgOne: { |
| 64 | width: Dimensions.get("window").width, | 133 | width: Dimensions.get("window").width, |
| 65 | - height: Dimensions.get("window").width * 3118 / 640, | 134 | + height: Dimensions.get("window").width * 3118 / 640 |
| 66 | }, | 135 | }, |
| 67 | imgTwo: { | 136 | imgTwo: { |
| 68 | width: Dimensions.get("window").width, | 137 | width: Dimensions.get("window").width, |
| 69 | - height: Dimensions.get("window").width * 1651 / 690, | 138 | + height: Dimensions.get("window").width * 1651 / 690 |
| 70 | - } | 139 | + }, |
| 140 | + footer: { | ||
| 141 | + position: "absolute", | ||
| 142 | + bottom: 0, | ||
| 143 | + backgroundColor: "white", | ||
| 144 | + height: 49, | ||
| 145 | + width: Dimensions.get("window").width, | ||
| 146 | + flexDirection: "row", | ||
| 147 | + flex: 1, | ||
| 148 | + }, | ||
| 149 | + footerLeft: { | ||
| 150 | + flex: 1, | ||
| 151 | + justifyContent: "center", | ||
| 152 | + alignItems: "flex-start", | ||
| 153 | + paddingLeft: 15, | ||
| 154 | + }, | ||
| 155 | + price: { | ||
| 156 | + color: "#1B9341", | ||
| 157 | + fontSize: 18, | ||
| 158 | + }, | ||
| 159 | + footerRight: { | ||
| 160 | + backgroundColor: "#1B9341", | ||
| 161 | + width: 144, | ||
| 162 | + justifyContent: "center", | ||
| 163 | + alignItems: "center", | ||
| 164 | + }, | ||
| 165 | + button: { | ||
| 166 | + color: "white", | ||
| 167 | + fontSize: 16, | ||
| 168 | + }, | ||
| 71 | }); | 169 | }); |
src/assets/home/ic_feature@2x.png
0 → 100644
2.02 KB
src/assets/home/ic_feature@3x.png
0 → 100644
3.5 KB
src/assets/home/归档.zip
0 → 100644
No preview for this file type
| @@ -20,18 +20,12 @@ export default class AllProduct extends Component { | @@ -20,18 +20,12 @@ export default class AllProduct extends Component { | ||
| 20 | ListData: [ | 20 | ListData: [ |
| 21 | { | 21 | { |
| 22 | title: "平安e生保2017版-100万(有社保含新农合)", | 22 | title: "平安e生保2017版-100万(有社保含新农合)", |
| 23 | - time: "刚刚", | ||
| 24 | - // url: "http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html", | ||
| 25 | - url: require("../../assets/home/product_long_1.jpg"), | ||
| 26 | Subtitle: "200万医疗险,续保至99岁免审核", | 23 | Subtitle: "200万医疗险,续保至99岁免审核", |
| 27 | imgurl: require("../../assets/home/product_1.png") | 24 | imgurl: require("../../assets/home/product_1.png") |
| 28 | }, | 25 | }, |
| 29 | { | 26 | { |
| 30 | title: "泰康在线“住院宝”必备版(0-49周岁)", | 27 | title: "泰康在线“住院宝”必备版(0-49周岁)", |
| 31 | - time: "刚刚", | ||
| 32 | Subtitle: "疾病意外全面保障,补充社保不足,公共交通意外双倍赔付", | 28 | Subtitle: "疾病意外全面保障,补充社保不足,公共交通意外双倍赔付", |
| 33 | - // url: "http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html", | ||
| 34 | - url: require("../../assets/home/product_long_2.jpg"), | ||
| 35 | imgurl: require("../../assets/home/product_2.png") | 29 | imgurl: require("../../assets/home/product_2.png") |
| 36 | }, | 30 | }, |
| 37 | ] | 31 | ] |
-
Please register or login to post a comment