Solution.js
4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import React, { Component } from "react";
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
TouchableOpacity,
ScrollView,
ListView,
Dimensions
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
export default class Home extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentWillMount() {}
componentDidMount() {}
getListData() {
let that = this;
return fetch(`https://devpay.brae.co/test/insurance/topic`, {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json"
}
})
.then(resp => {
if (resp.status === 200) {
return resp.json();
} else {
console.error("something went wrong!");
}
})
.then(respJson => {
if (respJson.enmsg != "ok") {
alert(respJson.cnmsg);
} else {
that.setState({
ListData: respJson.data.topic
});
console.log("首页列表", this.state.ListData);
}
});
}
render() {
console.log("solution", this.props.navigation.state.params.answerList);
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<View style={styles.ownContaier}>
<View style={styles.headerContainer}>
<View style={styles.titleWrapper}>
<Text style={styles.headerTitle}>关于自己的保险方案</Text>
</View>
</View>
<View style={styles.infoContainer}>
<View style={styles.leftInfoContaier}>
<View style={styles.TInfoContaier}>
<Text>年龄:</Text>
<Text>16岁</Text>
</View>
<View style={styles.BInfoContaier}>
<Text>个人年收入:</Text>
<Text>10万</Text>
</View>
</View>
<View style={styles.rightInfoContaier}>
<View style={styles.TInfoContaier}>
<Text>社保:</Text>
<Text>有社保</Text>
</View>
<View style={styles.BInfoContaier}>
<Text>负责:</Text>
<Text>XXX贷款</Text>
</View>
</View>
</View>
<View style={styles.adviceContainer}>
<Text style={styles.adviceText}>
作为家庭的经济支柱,压力和责任重大,应优先进行保险配置,且应占家庭保险的中支出和总保额的大比重,建议依次配置以下产品,以保障家庭持续、高品质的运营
</Text>
</View>
</View>
<View style={styles.configureContaier}>
<View style={styles.headerContainer}>
<View style={styles.titleWrapper}>
<Text style={styles.headerTitle}>保险配置方案</Text>
</View>
</View>
<View style={styles.tableContainer}>
<Text>表格</Text>
</View>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#F0F0F0"
},
ownContaier: {
backgroundColor: "white",
marginTop: 10
},
headerContainer: {
marginLeft: 10,
height: 45,
justifyContent: "center",
alignItems: "flex-start"
},
titleWrapper: {
borderStyle: "solid",
borderColor: "#009B3A",
borderLeftWidth: 2,
paddingLeft: 7
},
headerTitle: {
fontSize: 16,
fontWeight: "bold"
},
infoContainer: {
marginLeft: 18,
borderStyle: "solid",
borderColor: "#E8E8E8",
borderTopWidth: 0.5,
flexDirection: "row",
paddingVertical: 12,
},
leftInfoContaier: {
flex: 1,
justifyContent: "center",
alignItems: "flex-start"
},
rightInfoContaier: {
flex: 1,
justifyContent: "center",
alignItems: "flex-start"
},
TInfoContaier: {
flexDirection: "row",
marginBottom: 12,
},
BInfoContaier: {
flexDirection: "row",
},
adviceContainer: {
marginLeft: 18,
paddingRight: 18,
borderStyle: "solid",
borderColor: "#E8E8E8",
borderTopWidth: 0.5,
paddingVertical: 12,
},
adviceText: {
fontSize: 13,
lineHeight: 20,
color: "#242424",
},
configureContaier: {
backgroundColor: "white",
marginTop: 10
}
});