Showing
2 changed files
with
117 additions
and
8 deletions
| @@ -155,13 +155,18 @@ export default class Home extends Component { | @@ -155,13 +155,18 @@ export default class Home extends Component { | ||
| 155 | 155 | ||
| 156 | submit() { | 156 | submit() { |
| 157 | const that = this; | 157 | const that = this; |
| 158 | + const { navigate } = this.props.navigation; | ||
| 158 | let Temp = this.state.QuesList.map(item => item.answers[item.selected]); | 159 | let Temp = this.state.QuesList.map(item => item.answers[item.selected]); |
| 159 | - console.log(Temp) | 160 | + console.log(Temp); |
| 160 | - Temp.splice(3,1,that.format(that.state.date)); | 161 | + Temp.splice(3, 1, that.format(that.state.date)); |
| 161 | - that.setState({ | 162 | + that.setState( |
| 163 | + { | ||
| 162 | answerList: Temp | 164 | answerList: Temp |
| 163 | - }) | 165 | + }, |
| 164 | - console.log("hh") | 166 | + () => { |
| 167 | + navigate("AISolution", { answerList: that.state.answerList }); | ||
| 168 | + } | ||
| 169 | + ); | ||
| 165 | } | 170 | } |
| 166 | 171 | ||
| 167 | format(date) { | 172 | format(date) { |
| @@ -8,7 +8,7 @@ import { | @@ -8,7 +8,7 @@ import { | ||
| 8 | TouchableOpacity, | 8 | TouchableOpacity, |
| 9 | ScrollView, | 9 | ScrollView, |
| 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 } from "react-navigation"; |
| 14 | 14 | ||
| @@ -50,10 +50,52 @@ export default class Home extends Component { | @@ -50,10 +50,52 @@ export default class Home extends Component { | ||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | render() { | 52 | render() { |
| 53 | + console.log("solution", this.props.navigation.state.params.answerList); | ||
| 53 | const { navigate } = this.props.navigation; | 54 | const { navigate } = this.props.navigation; |
| 54 | return ( | 55 | return ( |
| 55 | <View style={styles.container}> | 56 | <View style={styles.container}> |
| 56 | - <Text>智能解决方案</Text> | 57 | + <View style={styles.ownContaier}> |
| 58 | + <View style={styles.headerContainer}> | ||
| 59 | + <View style={styles.titleWrapper}> | ||
| 60 | + <Text style={styles.headerTitle}>关于自己的保险方案</Text> | ||
| 61 | + </View> | ||
| 62 | + </View> | ||
| 63 | + <View style={styles.infoContainer}> | ||
| 64 | + <View style={styles.leftInfoContaier}> | ||
| 65 | + <View style={styles.TInfoContaier}> | ||
| 66 | + <Text>年龄:</Text> | ||
| 67 | + <Text>16岁</Text> | ||
| 68 | + </View> | ||
| 69 | + <View style={styles.BInfoContaier}> | ||
| 70 | + <Text>个人年收入:</Text> | ||
| 71 | + <Text>10万</Text> | ||
| 72 | + </View> | ||
| 73 | + </View> | ||
| 74 | + <View style={styles.rightInfoContaier}> | ||
| 75 | + <View style={styles.TInfoContaier}> | ||
| 76 | + <Text>社保:</Text> | ||
| 77 | + <Text>有社保</Text> | ||
| 78 | + </View> | ||
| 79 | + <View style={styles.BInfoContaier}> | ||
| 80 | + <Text>负责:</Text> | ||
| 81 | + <Text>XXX贷款</Text> | ||
| 82 | + </View> | ||
| 83 | + </View> | ||
| 84 | + </View> | ||
| 85 | + <View style={styles.adviceContainer}> | ||
| 86 | + <Text style={styles.adviceText}> | ||
| 87 | + 作为家庭的经济支柱,压力和责任重大,应优先进行保险配置,且应占家庭保险的中支出和总保额的大比重,建议依次配置以下产品,以保障家庭持续、高品质的运营 | ||
| 88 | + </Text> | ||
| 89 | + </View> | ||
| 90 | + </View> | ||
| 91 | + <View style={styles.configureContaier}> | ||
| 92 | + <View style={styles.headerContainer}> | ||
| 93 | + <View style={styles.titleWrapper}> | ||
| 94 | + <Text style={styles.headerTitle}>保险配置方案</Text> | ||
| 95 | + </View> | ||
| 96 | + </View> | ||
| 97 | + <View style={styles.tableContainer} /> | ||
| 98 | + </View> | ||
| 57 | </View> | 99 | </View> |
| 58 | ); | 100 | ); |
| 59 | } | 101 | } |
| @@ -64,6 +106,68 @@ const styles = StyleSheet.create({ | @@ -64,6 +106,68 @@ const styles = StyleSheet.create({ | ||
| 64 | flex: 1, | 106 | flex: 1, |
| 65 | justifyContent: "flex-start", | 107 | justifyContent: "flex-start", |
| 66 | alignItems: "stretch", | 108 | alignItems: "stretch", |
| 67 | - backgroundColor: "#EFEFEF" | 109 | + backgroundColor: "#F0F0F0" |
| 68 | }, | 110 | }, |
| 111 | + ownContaier: { | ||
| 112 | + backgroundColor: "white", | ||
| 113 | + marginTop: 10 | ||
| 114 | + }, | ||
| 115 | + headerContainer: { | ||
| 116 | + marginLeft: 10, | ||
| 117 | + height: 45, | ||
| 118 | + justifyContent: "center", | ||
| 119 | + alignItems: "flex-start" | ||
| 120 | + }, | ||
| 121 | + titleWrapper: { | ||
| 122 | + borderStyle: "solid", | ||
| 123 | + borderColor: "#009B3A", | ||
| 124 | + borderLeftWidth: 2, | ||
| 125 | + paddingLeft: 7 | ||
| 126 | + }, | ||
| 127 | + headerTitle: { | ||
| 128 | + fontSize: 16, | ||
| 129 | + fontWeight: "bold" | ||
| 130 | + }, | ||
| 131 | + infoContainer: { | ||
| 132 | + marginLeft: 18, | ||
| 133 | + borderStyle: "solid", | ||
| 134 | + borderColor: "#E8E8E8", | ||
| 135 | + borderTopWidth: 0.5, | ||
| 136 | + flexDirection: "row", | ||
| 137 | + paddingVertical: 12, | ||
| 138 | + }, | ||
| 139 | + leftInfoContaier: { | ||
| 140 | + flex: 1, | ||
| 141 | + justifyContent: "center", | ||
| 142 | + alignItems: "flex-start" | ||
| 143 | + }, | ||
| 144 | + rightInfoContaier: { | ||
| 145 | + flex: 1, | ||
| 146 | + justifyContent: "center", | ||
| 147 | + alignItems: "flex-start" | ||
| 148 | + }, | ||
| 149 | + TInfoContaier: { | ||
| 150 | + flexDirection: "row", | ||
| 151 | + marginBottom: 12, | ||
| 152 | + }, | ||
| 153 | + BInfoContaier: { | ||
| 154 | + flexDirection: "row", | ||
| 155 | + }, | ||
| 156 | + adviceContainer: { | ||
| 157 | + marginLeft: 18, | ||
| 158 | + paddingRight: 18, | ||
| 159 | + borderStyle: "solid", | ||
| 160 | + borderColor: "#E8E8E8", | ||
| 161 | + borderTopWidth: 0.5, | ||
| 162 | + paddingVertical: 12, | ||
| 163 | + }, | ||
| 164 | + adviceText: { | ||
| 165 | + fontSize: 13, | ||
| 166 | + lineHeight: 20, | ||
| 167 | + color: "#242424", | ||
| 168 | + }, | ||
| 169 | + configureContaier: { | ||
| 170 | + backgroundColor: "white", | ||
| 171 | + marginTop: 10 | ||
| 172 | + } | ||
| 69 | }); | 173 | }); |
-
Please register or login to post a comment