Showing
2 changed files
with
41 additions
and
7 deletions
| @@ -15,7 +15,20 @@ import { StackNavigator, TabNavigator } from "react-navigation"; | @@ -15,7 +15,20 @@ import { StackNavigator, TabNavigator } from "react-navigation"; | ||
| 15 | export default class Home extends Component { | 15 | export default class Home extends Component { |
| 16 | constructor(props) { | 16 | constructor(props) { |
| 17 | super(props); | 17 | super(props); |
| 18 | - this.state = {}; | 18 | + this.state = { |
| 19 | + QuesList: [ | ||
| 20 | + { | ||
| 21 | + title: "1.我该称呼您先生还是女士呢?", | ||
| 22 | + answers: ["先生","女士"], | ||
| 23 | + },{ | ||
| 24 | + title: "2.请问您是否有家庭负债?", | ||
| 25 | + answers: ["有贷款","无贷款"], | ||
| 26 | + },{ | ||
| 27 | + title: "3.您要为哪些家人投保呢?", | ||
| 28 | + answers: ["先生","配偶","儿子","女儿","母亲","父亲"] | ||
| 29 | + } | ||
| 30 | + ] | ||
| 31 | + }; | ||
| 19 | } | 32 | } |
| 20 | componentWillMount() {} | 33 | componentWillMount() {} |
| 21 | 34 | ||
| @@ -49,6 +62,13 @@ export default class Home extends Component { | @@ -49,6 +62,13 @@ export default class Home extends Component { | ||
| 49 | }); | 62 | }); |
| 50 | } | 63 | } |
| 51 | 64 | ||
| 65 | + _renderQuestion() { | ||
| 66 | + const { QuesList } = this.state; | ||
| 67 | + return ( | ||
| 68 | + <Text>列表</Text> | ||
| 69 | + ) | ||
| 70 | + } | ||
| 71 | + | ||
| 52 | render() { | 72 | render() { |
| 53 | // console.log("首页的this.props", this); | 73 | // console.log("首页的this.props", this); |
| 54 | // console.log("render首页文章列表", this.state.ListData); | 74 | // console.log("render首页文章列表", this.state.ListData); |
| @@ -56,9 +76,11 @@ export default class Home extends Component { | @@ -56,9 +76,11 @@ export default class Home extends Component { | ||
| 56 | return ( | 76 | return ( |
| 57 | <View style={styles.container}> | 77 | <View style={styles.container}> |
| 58 | <Text>智能问题</Text> | 78 | <Text>智能问题</Text> |
| 79 | + {this._renderQuestion()} | ||
| 59 | </View> | 80 | </View> |
| 60 | ); | 81 | ); |
| 61 | } | 82 | } |
| 83 | + | ||
| 62 | } | 84 | } |
| 63 | 85 | ||
| 64 | const styles = StyleSheet.create({ | 86 | const styles = StyleSheet.create({ |
| @@ -66,6 +88,6 @@ const styles = StyleSheet.create({ | @@ -66,6 +88,6 @@ const styles = StyleSheet.create({ | ||
| 66 | flex: 1, | 88 | flex: 1, |
| 67 | justifyContent: "flex-start", | 89 | justifyContent: "flex-start", |
| 68 | alignItems: "stretch", | 90 | alignItems: "stretch", |
| 69 | - backgroundColor: "#EFEFEF" | 91 | + backgroundColor: "#F0F0F0" |
| 70 | }, | 92 | }, |
| 71 | }); | 93 | }); |
| @@ -166,7 +166,7 @@ export default class Home extends Component { | @@ -166,7 +166,7 @@ export default class Home extends Component { | ||
| 166 | navigate("AIBegin"); | 166 | navigate("AIBegin"); |
| 167 | }} | 167 | }} |
| 168 | > | 168 | > |
| 169 | - <Image style={styles.AHIcon} /> | 169 | + <Image style={styles.AHIcon} source={require("../../assets/home/ic_intellect.png")} /> |
| 170 | <Text style={styles.AHText}>智能方案</Text> | 170 | <Text style={styles.AHText}>智能方案</Text> |
| 171 | </TouchableOpacity> | 171 | </TouchableOpacity> |
| 172 | <TouchableOpacity | 172 | <TouchableOpacity |
| @@ -175,7 +175,7 @@ export default class Home extends Component { | @@ -175,7 +175,7 @@ export default class Home extends Component { | ||
| 175 | navigate("HealthBegin"); | 175 | navigate("HealthBegin"); |
| 176 | }} | 176 | }} |
| 177 | > | 177 | > |
| 178 | - <Image style={styles.AHIcon} /> | 178 | + <Image style={styles.AHIcon} source={require("../../assets/home/ic_questionnaire.png")}/> |
| 179 | <Text style={styles.AHText}>健康问卷</Text> | 179 | <Text style={styles.AHText}>健康问卷</Text> |
| 180 | </TouchableOpacity> | 180 | </TouchableOpacity> |
| 181 | </View> | 181 | </View> |
| @@ -265,9 +265,21 @@ const styles = StyleSheet.create({ | @@ -265,9 +265,21 @@ const styles = StyleSheet.create({ | ||
| 265 | paddingTop: 10, | 265 | paddingTop: 10, |
| 266 | paddingBottom: 10, | 266 | paddingBottom: 10, |
| 267 | }, | 267 | }, |
| 268 | - AHContainer: {}, | 268 | + AHContainer: { |
| 269 | - AHIcon: {}, | 269 | + flexDirection: "row", |
| 270 | - AHText: {}, | 270 | + justifyContent: "center", |
| 271 | + alignItems: "center", | ||
| 272 | + | ||
| 273 | + }, | ||
| 274 | + AHIcon: { | ||
| 275 | + width: 40, | ||
| 276 | + height: 40, | ||
| 277 | + }, | ||
| 278 | + AHText: { | ||
| 279 | + fontSize: 16, | ||
| 280 | + color: "#242424", | ||
| 281 | + marginLeft: 13, | ||
| 282 | + }, | ||
| 271 | textContainer: { | 283 | textContainer: { |
| 272 | backgroundColor: "#fff", | 284 | backgroundColor: "#fff", |
| 273 | marginTop: 10, | 285 | marginTop: 10, |
-
Please register or login to post a comment