Showing
1 changed file
with
41 additions
and
7 deletions
| @@ -10,7 +10,7 @@ import { | @@ -10,7 +10,7 @@ import { | ||
| 10 | ListView, | 10 | ListView, |
| 11 | Dimensions | 11 | Dimensions |
| 12 | } from "react-native"; | 12 | } from "react-native"; |
| 13 | -import { StackNavigator, TabNavigator } from "react-navigation"; | 13 | +import { StackNavigator, TabNavigator, NavigationActions } from "react-navigation"; |
| 14 | import { Col, Row, Grid } from "react-native-easy-grid"; | 14 | import { Col, Row, Grid } from "react-native-easy-grid"; |
| 15 | 15 | ||
| 16 | export default class Home extends Component { | 16 | export default class Home extends Component { |
| @@ -42,7 +42,7 @@ export default class Home extends Component { | @@ -42,7 +42,7 @@ export default class Home extends Component { | ||
| 42 | eachyear: "150元" | 42 | eachyear: "150元" |
| 43 | } | 43 | } |
| 44 | ], | 44 | ], |
| 45 | - count: "1200", | 45 | + count: "1200" |
| 46 | } | 46 | } |
| 47 | }; | 47 | }; |
| 48 | } | 48 | } |
| @@ -78,8 +78,19 @@ export default class Home extends Component { | @@ -78,8 +78,19 @@ export default class Home extends Component { | ||
| 78 | }); | 78 | }); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | + submit() { | ||
| 82 | + this.props.navigation.dispatch(NavigationActions.reset({ | ||
| 83 | + index: 0, | ||
| 84 | + actions: [ | ||
| 85 | + NavigationActions.navigate({ | ||
| 86 | + routeName: "MainTabBar" | ||
| 87 | + }) | ||
| 88 | + ] | ||
| 89 | + })) | ||
| 90 | + } | ||
| 91 | + | ||
| 81 | render() { | 92 | render() { |
| 82 | - console.log("solution", this.props.navigation.state.params.answerList); | 93 | + console.log("solution", this.props.navigation); |
| 83 | const { navigate } = this.props.navigation; | 94 | const { navigate } = this.props.navigation; |
| 84 | const { gridData } = this.state; | 95 | const { gridData } = this.state; |
| 85 | return ( | 96 | return ( |
| @@ -190,12 +201,22 @@ export default class Home extends Component { | @@ -190,12 +201,22 @@ export default class Home extends Component { | ||
| 190 | </Grid> | 201 | </Grid> |
| 191 | </ScrollView> | 202 | </ScrollView> |
| 192 | <View style={styles.tipsContainer}> | 203 | <View style={styles.tipsContainer}> |
| 193 | - <Image style={{width: 16, height: 16}} source={require("../../../assets/home/ic_notice.png")} /> | 204 | + <Image |
| 205 | + style={{ width: 16, height: 16 }} | ||
| 206 | + source={require("../../../assets/home/ic_notice.png")} | ||
| 207 | + /> | ||
| 194 | <Text style={styles.tipsText}>保险配置预算仅供参考,实际缴费金额与投保时内容有关。</Text> | 208 | <Text style={styles.tipsText}>保险配置预算仅供参考,实际缴费金额与投保时内容有关。</Text> |
| 195 | </View> | 209 | </View> |
| 196 | </View> | 210 | </View> |
| 197 | 211 | ||
| 198 | - | 212 | + <TouchableOpacity |
| 213 | + onPress={() => { | ||
| 214 | + this.submit(); | ||
| 215 | + }} | ||
| 216 | + style={styles.confirmBtn} | ||
| 217 | + > | ||
| 218 | + <Text style={styles.confirmBtnText}>完成</Text> | ||
| 219 | + </TouchableOpacity> | ||
| 199 | </View> | 220 | </View> |
| 200 | ); | 221 | ); |
| 201 | } | 222 | } |
| @@ -328,12 +349,25 @@ const styles = StyleSheet.create({ | @@ -328,12 +349,25 @@ const styles = StyleSheet.create({ | ||
| 328 | flexDirection: "row", | 349 | flexDirection: "row", |
| 329 | alignItems: "center", | 350 | alignItems: "center", |
| 330 | marginHorizontal: 24, | 351 | marginHorizontal: 24, |
| 331 | - marginBottom: 10, | 352 | + marginBottom: 10 |
| 332 | }, | 353 | }, |
| 333 | tipsText: { | 354 | tipsText: { |
| 334 | fontSize: 12, | 355 | fontSize: 12, |
| 335 | color: "#7A7A7A", | 356 | color: "#7A7A7A", |
| 336 | lineHeight: 17, | 357 | lineHeight: 17, |
| 337 | - marginLeft: 5, | 358 | + marginLeft: 5 |
| 359 | + }, | ||
| 360 | + confirmBtn: { | ||
| 361 | + marginVertical: 20, | ||
| 362 | + marginHorizontal: 40, | ||
| 363 | + justifyContent: "center", | ||
| 364 | + alignItems: "center", | ||
| 365 | + backgroundColor: "#1B9341", | ||
| 366 | + height: 45, | ||
| 367 | + borderRadius: 5 | ||
| 368 | + }, | ||
| 369 | + confirmBtnText: { | ||
| 370 | + fontSize: 16, | ||
| 371 | + color: "white" | ||
| 338 | }, | 372 | }, |
| 339 | }); | 373 | }); |
-
Please register or login to post a comment