Showing
48 changed files
with
505 additions
and
147 deletions
src/Components/CommonWebView.js
0 → 100644
| 1 | +import React, { Component } from 'react'; | ||
| 2 | +import { | ||
| 3 | + StyleSheet, | ||
| 4 | + WebView, | ||
| 5 | + View, | ||
| 6 | +} from 'react-native'; | ||
| 7 | + | ||
| 8 | +export default class CommonWebview extends Component { | ||
| 9 | + constructor(props) { | ||
| 10 | + super(props); | ||
| 11 | + } | ||
| 12 | + render() { | ||
| 13 | + console.log("url",this.props.url) | ||
| 14 | + return ( | ||
| 15 | + <WebView | ||
| 16 | + style={styles.container} | ||
| 17 | + source={{uri: this.props.url}} | ||
| 18 | + /> | ||
| 19 | + ); | ||
| 20 | + } | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +const styles = StyleSheet.create({ | ||
| 25 | + container: { | ||
| 26 | + flex: 1, | ||
| 27 | + paddingTop: 64, | ||
| 28 | + justifyContent: "flex-start", | ||
| 29 | + alignItems: "stretch", | ||
| 30 | + backgroundColor: "#EFEFEF" | ||
| 31 | + }, | ||
| 32 | +}); |
src/assets/Mine/iconpic1.png
0 → 100644
29.5 KB
src/assets/Mine/rightArrow_gray.png
0 → 100644
4.89 KB
src/assets/Mine/rightArrow_white.png
0 → 100644
4.22 KB
src/assets/circle/iconpic1.png
0 → 100644
29.5 KB
src/assets/circle/newspic.png
0 → 100644
84.8 KB
src/pages/Home/NewList.js
deleted
100644 → 0
| 1 | -/** | ||
| 2 | - * Sample React Native App | ||
| 3 | - * https://github.com/facebook/react-native | ||
| 4 | - * @flow | ||
| 5 | - */ | ||
| 6 | - | ||
| 7 | -import React, { Component } from "react"; | ||
| 8 | -import { AppRegistry, StyleSheet, Text, View, TouchableOpacity, Image, ScrollView } from "react-native"; | ||
| 9 | - | ||
| 10 | -export default class NewsList extends Component { | ||
| 11 | - render() { | ||
| 12 | - return ( | ||
| 13 | - <ScrollView style={styles.container} automaticallyAdjustContentInsets={false}> | ||
| 14 | - <ListItem title={"平安保险2017版"} context={"600万医疗报废,自费药,进口药,器材费"} /> | ||
| 15 | - <ListItem title={"平安保险2017版"} context={"600万医疗报废,自费药,进口药,器材费"} /> | ||
| 16 | - <ListItem title={"平安保险2017版"} context={"600万医疗报废,自费药,进口药,器材费"} /> | ||
| 17 | - <ListItem title={"平安保险2017版"} context={"600万医疗报废,自费药,进口药,器材费"} /> | ||
| 18 | - </ScrollView> | ||
| 19 | - ); | ||
| 20 | - } | ||
| 21 | -} | ||
| 22 | - | ||
| 23 | -class ListItem extends Component { | ||
| 24 | - render() { | ||
| 25 | - return ( | ||
| 26 | - <TouchableOpacity style={styles.itemContainer}> | ||
| 27 | - <View style={styles.itemImgWrapper}></View> | ||
| 28 | - <View style={styles.itemRightWrapper}> | ||
| 29 | - <Text style={styles.itemTextTop}>{this.props.title}</Text> | ||
| 30 | - <Text style={styles.itemTextBottom}>{this.props.context}</Text> | ||
| 31 | - </View> | ||
| 32 | - </TouchableOpacity> | ||
| 33 | - ) | ||
| 34 | - } | ||
| 35 | -} | ||
| 36 | - | ||
| 37 | -const styles = StyleSheet.create({ | ||
| 38 | - container: { | ||
| 39 | - height:150, | ||
| 40 | - }, | ||
| 41 | - itemContainer: { | ||
| 42 | - height: 90, | ||
| 43 | - backgroundColor: "#fff", | ||
| 44 | - flexDirection: 'row', | ||
| 45 | - alignItems: "center", | ||
| 46 | - borderTopWidth: 1, | ||
| 47 | - borderTopColor: "#EEEEEE", | ||
| 48 | - borderStyle: "solid", | ||
| 49 | - paddingLeft: 13, | ||
| 50 | - paddingRight: 13, | ||
| 51 | - }, | ||
| 52 | - itemImgWrapper: { | ||
| 53 | - width:74, | ||
| 54 | - height:66, | ||
| 55 | - backgroundColor: "#ccc", | ||
| 56 | - marginRight: 12 | ||
| 57 | - }, | ||
| 58 | - itemRightWrapper: { | ||
| 59 | - justifyContent: "center", | ||
| 60 | - height: 66, | ||
| 61 | - flex: 1 | ||
| 62 | - // marginRight: 13 | ||
| 63 | - }, | ||
| 64 | - itemTextTop: { | ||
| 65 | - fontSize: 16, | ||
| 66 | - color: "#202020", | ||
| 67 | - lineHeight: 21 | ||
| 68 | - }, | ||
| 69 | - itemTextBottom: { | ||
| 70 | - fontSize: 13, | ||
| 71 | - color: "#7A7A7A", | ||
| 72 | - lineHeight: 18 | ||
| 73 | - }, | ||
| 74 | -}); |
src/pages/Home/allProduct.js
0 → 100644
| 1 | +import React, { Component } from "react"; | ||
| 2 | +import { | ||
| 3 | + AppRegistry, | ||
| 4 | + StyleSheet, | ||
| 5 | + Text, | ||
| 6 | + View, | ||
| 7 | + ScrollView, | ||
| 8 | + TouchableOpacity, | ||
| 9 | + Image | ||
| 10 | +} from "react-native"; | ||
| 11 | +import CommonWebView from "../../Components/CommonWebView"; | ||
| 12 | + | ||
| 13 | +export default class AllProduct extends Component { | ||
| 14 | + constructor(props) { | ||
| 15 | + super(props); | ||
| 16 | + this.state = { | ||
| 17 | + ListData: [ | ||
| 18 | + { | ||
| 19 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 20 | + time: "刚刚", | ||
| 21 | + url: "https://www.baidu.com", | ||
| 22 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 23 | + }, | ||
| 24 | + { | ||
| 25 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 26 | + time: "刚刚", | ||
| 27 | + url: "https://www.google.com", | ||
| 28 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 29 | + }, | ||
| 30 | + { | ||
| 31 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 32 | + time: "刚刚", | ||
| 33 | + url: "https://www.zhihu.com/", | ||
| 34 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 35 | + }, | ||
| 36 | + { | ||
| 37 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 38 | + time: "刚刚", | ||
| 39 | + url: "https://www.baidu.com", | ||
| 40 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 41 | + } | ||
| 42 | + ] | ||
| 43 | + }; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + render() { | ||
| 47 | + return ( | ||
| 48 | + <View style={styles.container}> | ||
| 49 | + {/* <NewsList /> */} | ||
| 50 | + <ScrollView | ||
| 51 | + style={styles.scrollViewContainer} | ||
| 52 | + automaticallyAdjustContentInsets={false} | ||
| 53 | + > | ||
| 54 | + {this.state.ListData.map((item, index) => { | ||
| 55 | + return ( | ||
| 56 | + <TouchableOpacity | ||
| 57 | + style={styles.itemContainer} | ||
| 58 | + key={index} | ||
| 59 | + onPress={() => { | ||
| 60 | + this.props.navigator.push({ | ||
| 61 | + component: CommonWebView, | ||
| 62 | + passProps: { | ||
| 63 | + url: item.url | ||
| 64 | + } | ||
| 65 | + }); | ||
| 66 | + }} | ||
| 67 | + > | ||
| 68 | + <Image style={styles.itemImgWrapper} source={item.imgurl} /> | ||
| 69 | + <View style={styles.itemRightWrapper}> | ||
| 70 | + <Text style={styles.itemTextTop} numberOfLines={2}> | ||
| 71 | + {item.title} | ||
| 72 | + </Text> | ||
| 73 | + <Text style={styles.itemTextBottom}>{item.time}</Text> | ||
| 74 | + </View> | ||
| 75 | + </TouchableOpacity> | ||
| 76 | + ); | ||
| 77 | + })} | ||
| 78 | + </ScrollView> | ||
| 79 | + </View> | ||
| 80 | + ); | ||
| 81 | + } | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +const styles = StyleSheet.create({ | ||
| 85 | + container: { | ||
| 86 | + flex: 1, | ||
| 87 | + justifyContent: "flex-start", | ||
| 88 | + alignItems: "stretch", | ||
| 89 | + backgroundColor: "#EFEFEF", | ||
| 90 | + paddingTop: 74 | ||
| 91 | + }, | ||
| 92 | + scrollViewContainer: { | ||
| 93 | + height: 300 | ||
| 94 | + // backgroundColor: "red" | ||
| 95 | + }, | ||
| 96 | + scrollViewText: { | ||
| 97 | + color: "#7A7A7A", | ||
| 98 | + fontSize: 13, | ||
| 99 | + marginTop: 10, | ||
| 100 | + textAlign: "center" | ||
| 101 | + }, | ||
| 102 | + itemContainer: { | ||
| 103 | + height: 102, | ||
| 104 | + backgroundColor: "#fff", | ||
| 105 | + flexDirection: "row", | ||
| 106 | + alignItems: "center", | ||
| 107 | + borderTopWidth: 1, | ||
| 108 | + borderTopColor: "#EEEEEE", | ||
| 109 | + borderStyle: "solid", | ||
| 110 | + paddingLeft: 13, | ||
| 111 | + paddingRight: 13 | ||
| 112 | + }, | ||
| 113 | + itemImgWrapper: { | ||
| 114 | + width: 88, | ||
| 115 | + height: 78, | ||
| 116 | + // backgroundColor: "#ccc", | ||
| 117 | + marginRight: 12 | ||
| 118 | + }, | ||
| 119 | + itemRightWrapper: { | ||
| 120 | + justifyContent: "center", | ||
| 121 | + height: 66, | ||
| 122 | + flex: 1 | ||
| 123 | + // marginRight: 13 | ||
| 124 | + }, | ||
| 125 | + itemTextTop: { | ||
| 126 | + fontSize: 16, | ||
| 127 | + color: "#202020", | ||
| 128 | + lineHeight: 21 | ||
| 129 | + }, | ||
| 130 | + itemTextBottom: { | ||
| 131 | + fontSize: 13, | ||
| 132 | + color: "#7A7A7A", | ||
| 133 | + lineHeight: 18 | ||
| 134 | + } | ||
| 135 | +}); |
| 1 | import React, { Component } from "react"; | 1 | import React, { Component } from "react"; |
| 2 | -import { AppRegistry, StyleSheet, Text, View, Image, TouchableOpacity } from "react-native"; | 2 | +import { |
| 3 | + AppRegistry, | ||
| 4 | + StyleSheet, | ||
| 5 | + Text, | ||
| 6 | + View, | ||
| 7 | + Image, | ||
| 8 | + TouchableOpacity, | ||
| 9 | + ScrollView | ||
| 10 | +} from "react-native"; | ||
| 3 | import Carousel from "../../Components/Carousel"; | 11 | import Carousel from "../../Components/Carousel"; |
| 4 | -import NewsList from "./NewList"; | 12 | +import AllProduct from "./allProduct"; |
| 5 | - | 13 | +import CommonWebView from "../../Components/CommonWebView"; |
| 6 | -export default class Main extends Component { | ||
| 7 | 14 | ||
| 15 | +export default class Home extends Component { | ||
| 16 | + constructor(props) { | ||
| 17 | + super(props); | ||
| 18 | + this._renderMap = this._renderMap.bind(this); | ||
| 19 | + this.state = { | ||
| 20 | + ListData: [ | ||
| 21 | + { | ||
| 22 | + title: "平安保险第一个", | ||
| 23 | + context: "600万医疗报废,自费药,进口药,器材费", | ||
| 24 | + url: "https://www.baidu.com", | ||
| 25 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + title: "平安保险第二个", | ||
| 29 | + context: "600万医疗报废,自费药,进口药,器材费", | ||
| 30 | + url: "https://www.google.com", | ||
| 31 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 32 | + }, | ||
| 33 | + { | ||
| 34 | + title: "平安保险第三个", | ||
| 35 | + context: "600万医疗报废,自费药,进口药,器材费", | ||
| 36 | + url: "https://www.zhihu.com/", | ||
| 37 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 38 | + }, | ||
| 39 | + { | ||
| 40 | + title: "平安保险第四个", | ||
| 41 | + context: "600万医疗报废,自费药,进口药,器材费", | ||
| 42 | + url: "https://www.baidu.com", | ||
| 43 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 44 | + } | ||
| 45 | + ] | ||
| 46 | + }; | ||
| 47 | + } | ||
| 8 | componentDidMount() { | 48 | componentDidMount() { |
| 9 | - console.log('thisprops',this.props); | 49 | + console.log("thisprops", this.props); |
| 50 | + } | ||
| 51 | + _renderMap() { | ||
| 52 | + return this.state.ListData.map((item, index) => { | ||
| 53 | + return ( | ||
| 54 | + <TouchableOpacity | ||
| 55 | + style={styles.itemContainer} | ||
| 56 | + key={index} | ||
| 57 | + onPress={() => { | ||
| 58 | + this._jumpToWebView(item); | ||
| 59 | + }} | ||
| 60 | + > | ||
| 61 | + <Image style={styles.itemImgWrapper} source={item.imgurl} /> | ||
| 62 | + <View style={styles.itemRightWrapper}> | ||
| 63 | + <Text style={styles.itemTextTop}>{item.title}</Text> | ||
| 64 | + <Text style={styles.itemTextBottom}>{item.context}</Text> | ||
| 65 | + </View> | ||
| 66 | + </TouchableOpacity> | ||
| 67 | + ); | ||
| 68 | + }); | ||
| 69 | + } | ||
| 70 | + _jumpToWebView(item) { | ||
| 71 | + this.props.navigator.push({ | ||
| 72 | + component: CommonWebView, | ||
| 73 | + passProps: { | ||
| 74 | + url: item.url | ||
| 75 | + } | ||
| 76 | + }); | ||
| 77 | + } | ||
| 78 | + gotoAllProduct() { | ||
| 79 | + this.props.navigator.push({ | ||
| 80 | + component: AllProduct, | ||
| 81 | + title: "全部产品" | ||
| 82 | + }); | ||
| 10 | } | 83 | } |
| 11 | - | ||
| 12 | render() { | 84 | render() { |
| 13 | return ( | 85 | return ( |
| 14 | <View style={styles.container}> | 86 | <View style={styles.container}> |
| 15 | <Carousel /> | 87 | <Carousel /> |
| 16 | - <TouchableOpacity style={styles.midContainer}> | 88 | + <TouchableOpacity |
| 17 | - <Image source={require('../../assets/首页的副本/pic.png')} style={{width:72, height:18}} /> | 89 | + style={styles.midContainer} |
| 90 | + onPress={() => { | ||
| 91 | + this.gotoAllProduct(); | ||
| 92 | + }} | ||
| 93 | + > | ||
| 94 | + <Image | ||
| 95 | + source={require("../../assets/home/pic.png")} | ||
| 96 | + style={{ width: 72, height: 18 }} | ||
| 97 | + /> | ||
| 18 | <Text style={styles.midText}>平安保险2017版</Text> | 98 | <Text style={styles.midText}>平安保险2017版</Text> |
| 19 | </TouchableOpacity> | 99 | </TouchableOpacity> |
| 20 | <View style={styles.textContainer}> | 100 | <View style={styles.textContainer}> |
| 21 | <Text style={styles.minText}>保险头条</Text> | 101 | <Text style={styles.minText}>保险头条</Text> |
| 22 | </View> | 102 | </View> |
| 23 | - <NewsList /> | 103 | + <ScrollView |
| 104 | + style={styles.listContainer} | ||
| 105 | + automaticallyAdjustContentInsets={false} | ||
| 106 | + > | ||
| 107 | + {this._renderMap()} | ||
| 108 | + </ScrollView> | ||
| 24 | </View> | 109 | </View> |
| 25 | ); | 110 | ); |
| 26 | } | 111 | } |
| @@ -38,24 +123,59 @@ const styles = StyleSheet.create({ | @@ -38,24 +123,59 @@ const styles = StyleSheet.create({ | ||
| 38 | height: 45, | 123 | height: 45, |
| 39 | // width: 200, | 124 | // width: 200, |
| 40 | // alignSelf: 'center', | 125 | // alignSelf: 'center', |
| 41 | - backgroundColor: '#fff', | 126 | + backgroundColor: "#fff", |
| 42 | alignItems: "center", | 127 | alignItems: "center", |
| 43 | - flexDirection: 'row', | 128 | + flexDirection: "row", |
| 44 | paddingLeft: 13 | 129 | paddingLeft: 13 |
| 45 | }, | 130 | }, |
| 46 | midText: { | 131 | midText: { |
| 47 | fontSize: 15, | 132 | fontSize: 15, |
| 48 | paddingLeft: 9, | 133 | paddingLeft: 9, |
| 49 | // fontFamily: PingFang-SC-Medium, | 134 | // fontFamily: PingFang-SC-Medium, |
| 50 | - color: '#202020' | 135 | + color: "#202020" |
| 51 | }, | 136 | }, |
| 52 | textContainer: { | 137 | textContainer: { |
| 53 | - backgroundColor: '#fff', | 138 | + backgroundColor: "#fff", |
| 54 | marginTop: 10, | 139 | marginTop: 10, |
| 55 | height: 45, | 140 | height: 45, |
| 56 | justifyContent: "center", | 141 | justifyContent: "center", |
| 57 | - paddingLeft: 13, | 142 | + paddingLeft: 13 |
| 58 | // fontSize: 15, | 143 | // fontSize: 15, |
| 59 | // color: "#202020", | 144 | // color: "#202020", |
| 145 | + }, | ||
| 146 | + listContainer: { | ||
| 147 | + height: 150 | ||
| 148 | + }, | ||
| 149 | + itemContainer: { | ||
| 150 | + height: 90, | ||
| 151 | + backgroundColor: "#fff", | ||
| 152 | + flexDirection: "row", | ||
| 153 | + alignItems: "center", | ||
| 154 | + borderTopWidth: 1, | ||
| 155 | + borderTopColor: "#EEEEEE", | ||
| 156 | + borderStyle: "solid", | ||
| 157 | + paddingLeft: 13, | ||
| 158 | + paddingRight: 13 | ||
| 159 | + }, | ||
| 160 | + itemImgWrapper: { | ||
| 161 | + width: 74, | ||
| 162 | + height: 66, | ||
| 163 | + marginRight: 12 | ||
| 164 | + }, | ||
| 165 | + itemRightWrapper: { | ||
| 166 | + justifyContent: "center", | ||
| 167 | + height: 66, | ||
| 168 | + flex: 1 | ||
| 169 | + // marginRight: 13 | ||
| 170 | + }, | ||
| 171 | + itemTextTop: { | ||
| 172 | + fontSize: 16, | ||
| 173 | + color: "#202020", | ||
| 174 | + lineHeight: 21 | ||
| 175 | + }, | ||
| 176 | + itemTextBottom: { | ||
| 177 | + fontSize: 13, | ||
| 178 | + color: "#7A7A7A", | ||
| 179 | + lineHeight: 18 | ||
| 60 | } | 180 | } |
| 61 | }); | 181 | }); |
| 1 | - | 1 | +import React, { Component } from "react"; |
| 2 | -import React, { Component } from 'react'; | ||
| 3 | import { | 2 | import { |
| 4 | AppRegistry, | 3 | AppRegistry, |
| 5 | StyleSheet, | 4 | StyleSheet, |
| @@ -8,45 +7,78 @@ import { | @@ -8,45 +7,78 @@ import { | ||
| 8 | ScrollView, | 7 | ScrollView, |
| 9 | TouchableOpacity, | 8 | TouchableOpacity, |
| 10 | Image | 9 | Image |
| 11 | -} from 'react-native'; | 10 | +} from "react-native"; |
| 12 | - | 11 | +import CommonWebView from "../../Components/CommonWebView"; |
| 13 | - | ||
| 14 | 12 | ||
| 15 | export default class InsuranceChurch extends Component { | 13 | export default class InsuranceChurch extends Component { |
| 16 | - render() { | 14 | + constructor(props) { |
| 17 | - return ( | 15 | + super(props); |
| 18 | - <View style={styles.container}> | 16 | + // this._renderMap = this._renderMap.bind(this); |
| 19 | - <NewsList /> | 17 | + this.state = { |
| 20 | - </View> | 18 | + ListData: [ |
| 21 | - ); | 19 | + { |
| 20 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 21 | + time: "刚刚", | ||
| 22 | + url: "https://www.baidu.com", | ||
| 23 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 24 | + }, | ||
| 25 | + { | ||
| 26 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 27 | + time: "刚刚", | ||
| 28 | + url: "https://www.google.com", | ||
| 29 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 30 | + }, | ||
| 31 | + { | ||
| 32 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 33 | + time: "刚刚", | ||
| 34 | + url: "https://www.zhihu.com/", | ||
| 35 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 36 | + }, | ||
| 37 | + { | ||
| 38 | + title: "平安保险2017版平安保险平安保险平安保险", | ||
| 39 | + time: "刚刚", | ||
| 40 | + url: "https://www.baidu.com", | ||
| 41 | + imgurl: require("../../assets/circle/newspic.png") | ||
| 22 | } | 42 | } |
| 23 | -} | 43 | + ] |
| 24 | - | 44 | + }; |
| 25 | -class NewsList extends Component { | ||
| 26 | - render() { | ||
| 27 | - return ( | ||
| 28 | - <ScrollView style={styles.scrollViewContainer} automaticallyAdjustContentInsets={false}> | ||
| 29 | - <ListItem title={"平安保险2017版平安保险平安保险平安保险"} content={"刚刚"} /> | ||
| 30 | - <ListItem title={"平安保险2017版"} content={"刚刚"} /> | ||
| 31 | - <ListItem title={"平安保险2017版平安保险平安保险平安保平安保险2017版平安保险平安保险平安保险平安保险平安保险平安保险2017版平安保险平安保险平安保险平安保险平安保险险平安保险平安保险"} content={"刚刚"} /> | ||
| 32 | - <ListItem title={"平安保险2017版"} content={"刚刚"} /> | ||
| 33 | - <Text style={styles.scrollViewText}>没有更多了</Text> | ||
| 34 | - </ScrollView> | ||
| 35 | - ); | ||
| 36 | } | 45 | } |
| 37 | -} | ||
| 38 | 46 | ||
| 39 | -class ListItem extends Component { | ||
| 40 | render() { | 47 | render() { |
| 41 | return ( | 48 | return ( |
| 42 | - <TouchableOpacity style={styles.itemContainer}> | 49 | + <View style={styles.container}> |
| 43 | - <View style={styles.itemImgWrapper}></View> | 50 | + {/* <NewsList /> */} |
| 51 | + <ScrollView | ||
| 52 | + style={styles.scrollViewContainer} | ||
| 53 | + automaticallyAdjustContentInsets={false} | ||
| 54 | + > | ||
| 55 | + {this.state.ListData.map((item, index) => { | ||
| 56 | + return ( | ||
| 57 | + <TouchableOpacity | ||
| 58 | + style={styles.itemContainer} | ||
| 59 | + key={index} | ||
| 60 | + onPress={() => { | ||
| 61 | + this.props.navigator.push({ | ||
| 62 | + component: CommonWebView, | ||
| 63 | + passProps: { | ||
| 64 | + url: item.url | ||
| 65 | + } | ||
| 66 | + }); | ||
| 67 | + }} | ||
| 68 | + > | ||
| 69 | + <Image style={styles.itemImgWrapper} source={item.imgurl} /> | ||
| 44 | <View style={styles.itemRightWrapper}> | 70 | <View style={styles.itemRightWrapper}> |
| 45 | - <Text style={styles.itemTextTop} numberOfLines={2}>{this.props.title}</Text> | 71 | + <Text style={styles.itemTextTop} numberOfLines={2}> |
| 46 | - <Text style={styles.itemTextBottom}>{this.props.content}</Text> | 72 | + {item.title} |
| 73 | + </Text> | ||
| 74 | + <Text style={styles.itemTextBottom}>{item.time}</Text> | ||
| 47 | </View> | 75 | </View> |
| 48 | </TouchableOpacity> | 76 | </TouchableOpacity> |
| 49 | - ) | 77 | + ); |
| 78 | + })} | ||
| 79 | + </ScrollView> | ||
| 80 | + </View> | ||
| 81 | + ); | ||
| 50 | } | 82 | } |
| 51 | } | 83 | } |
| 52 | 84 | ||
| @@ -59,7 +91,7 @@ const styles = StyleSheet.create({ | @@ -59,7 +91,7 @@ const styles = StyleSheet.create({ | ||
| 59 | paddingTop: 74 | 91 | paddingTop: 74 |
| 60 | }, | 92 | }, |
| 61 | scrollViewContainer: { | 93 | scrollViewContainer: { |
| 62 | - height: 300, | 94 | + height: 300 |
| 63 | // backgroundColor: "red" | 95 | // backgroundColor: "red" |
| 64 | }, | 96 | }, |
| 65 | scrollViewText: { | 97 | scrollViewText: { |
| @@ -71,18 +103,18 @@ const styles = StyleSheet.create({ | @@ -71,18 +103,18 @@ const styles = StyleSheet.create({ | ||
| 71 | itemContainer: { | 103 | itemContainer: { |
| 72 | height: 102, | 104 | height: 102, |
| 73 | backgroundColor: "#fff", | 105 | backgroundColor: "#fff", |
| 74 | - flexDirection: 'row', | 106 | + flexDirection: "row", |
| 75 | alignItems: "center", | 107 | alignItems: "center", |
| 76 | borderTopWidth: 1, | 108 | borderTopWidth: 1, |
| 77 | borderTopColor: "#EEEEEE", | 109 | borderTopColor: "#EEEEEE", |
| 78 | borderStyle: "solid", | 110 | borderStyle: "solid", |
| 79 | paddingLeft: 13, | 111 | paddingLeft: 13, |
| 80 | - paddingRight: 13, | 112 | + paddingRight: 13 |
| 81 | }, | 113 | }, |
| 82 | itemImgWrapper: { | 114 | itemImgWrapper: { |
| 83 | - width:88, | 115 | + width: 88, |
| 84 | - height:78, | 116 | + height: 78, |
| 85 | - backgroundColor: "#ccc", | 117 | + // backgroundColor: "#ccc", |
| 86 | marginRight: 12 | 118 | marginRight: 12 |
| 87 | }, | 119 | }, |
| 88 | itemRightWrapper: { | 120 | itemRightWrapper: { |
| @@ -100,6 +132,5 @@ const styles = StyleSheet.create({ | @@ -100,6 +132,5 @@ const styles = StyleSheet.create({ | ||
| 100 | fontSize: 13, | 132 | fontSize: 13, |
| 101 | color: "#7A7A7A", | 133 | color: "#7A7A7A", |
| 102 | lineHeight: 18 | 134 | lineHeight: 18 |
| 103 | - }, | 135 | + } |
| 104 | }); | 136 | }); |
| 105 | - |
| @@ -9,12 +9,13 @@ import { | @@ -9,12 +9,13 @@ import { | ||
| 9 | TouchableOpacity, | 9 | TouchableOpacity, |
| 10 | Image | 10 | Image |
| 11 | } from 'react-native'; | 11 | } from 'react-native'; |
| 12 | +import CommonWebView from "../../Components/CommonWebView"; | ||
| 12 | 13 | ||
| 13 | export default class InsuranceCircle extends Component { | 14 | export default class InsuranceCircle extends Component { |
| 14 | render() { | 15 | render() { |
| 15 | return ( | 16 | return ( |
| 16 | <View style={styles.container}> | 17 | <View style={styles.container}> |
| 17 | - <NewsList /> | 18 | + <NewsList jumP={() => {this.props.navigator.push({component:CommonWebView,title:"hjjj",rightButtonTitle: 'Cancel',})}} /> |
| 18 | </View> | 19 | </View> |
| 19 | ); | 20 | ); |
| 20 | } | 21 | } |
| @@ -25,6 +26,7 @@ class NewsList extends Component { | @@ -25,6 +26,7 @@ class NewsList extends Component { | ||
| 25 | return ( | 26 | return ( |
| 26 | <ScrollView style={styles.scrollViewContainer} automaticallyAdjustContentInsets={false}> | 27 | <ScrollView style={styles.scrollViewContainer} automaticallyAdjustContentInsets={false}> |
| 27 | <ListItem | 28 | <ListItem |
| 29 | + jump={this.props.jumP} | ||
| 28 | title={"家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…"} | 30 | title={"家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…"} |
| 29 | content={"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…"} | 31 | content={"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…"} |
| 30 | name={"汉克斯"} | 32 | name={"汉克斯"} |
| @@ -45,13 +47,13 @@ class NewsList extends Component { | @@ -45,13 +47,13 @@ class NewsList extends Component { | ||
| 45 | class ListItem extends Component { | 47 | class ListItem extends Component { |
| 46 | render() { | 48 | render() { |
| 47 | return ( | 49 | return ( |
| 48 | - <TouchableOpacity style={styles.itemContainer}> | 50 | + <TouchableOpacity style={styles.itemContainer} onPress={this.props.jump}> |
| 49 | <Text style={styles.itemTitle} numberOfLines={2}>{this.props.title}</Text> | 51 | <Text style={styles.itemTitle} numberOfLines={2}>{this.props.title}</Text> |
| 50 | <Text style={styles.itemContent} numberOfLines={3}>{this.props.content}</Text> | 52 | <Text style={styles.itemContent} numberOfLines={3}>{this.props.content}</Text> |
| 51 | <View style={styles.itemInfoWrapper}> | 53 | <View style={styles.itemInfoWrapper}> |
| 52 | <View style={styles.itemInfoLeft}> | 54 | <View style={styles.itemInfoLeft}> |
| 53 | - {/* <Image style={styles.itemInfoIcon} /> */} | 55 | + <Image source={require("../../assets/Mine/iconpic1.png")} style={[styles.itemInfoIcon,{width:26, height:26}]} /> |
| 54 | - <View style={styles.itemInfoIcon}></View> | 56 | + {/* <View style={styles.itemInfoIcon}></View> */} |
| 55 | <Text style={styles.itemInfoName}>{this.props.name}</Text> | 57 | <Text style={styles.itemInfoName}>{this.props.name}</Text> |
| 56 | </View> | 58 | </View> |
| 57 | <Text style={styles.itemInfoRight}>{this.props.num} 评论</Text> | 59 | <Text style={styles.itemInfoRight}>{this.props.num} 评论</Text> |
| @@ -109,11 +111,7 @@ const styles = StyleSheet.create({ | @@ -109,11 +111,7 @@ const styles = StyleSheet.create({ | ||
| 109 | alignItems: "center", | 111 | alignItems: "center", |
| 110 | }, | 112 | }, |
| 111 | itemInfoIcon: { | 113 | itemInfoIcon: { |
| 112 | - width: 26, | ||
| 113 | - height: 26, | ||
| 114 | - backgroundColor: "#ccc", | ||
| 115 | marginRight: 10, | 114 | marginRight: 10, |
| 116 | - borderRadius: 26, | ||
| 117 | }, | 115 | }, |
| 118 | itemInfoName: { | 116 | itemInfoName: { |
| 119 | fontSize: 13, | 117 | fontSize: 13, |
| @@ -4,7 +4,9 @@ import { | @@ -4,7 +4,9 @@ import { | ||
| 4 | AppRegistry, | 4 | AppRegistry, |
| 5 | StyleSheet, | 5 | StyleSheet, |
| 6 | Text, | 6 | Text, |
| 7 | - View | 7 | + View, |
| 8 | + TouchableOpacity, | ||
| 9 | + Image, | ||
| 8 | } from 'react-native'; | 10 | } from 'react-native'; |
| 9 | 11 | ||
| 10 | 12 | ||
| @@ -13,25 +15,134 @@ export default class Mine extends Component { | @@ -13,25 +15,134 @@ export default class Mine extends Component { | ||
| 13 | render() { | 15 | render() { |
| 14 | return ( | 16 | return ( |
| 15 | <View style={styles.container}> | 17 | <View style={styles.container}> |
| 16 | - <Text style={styles.welcome}> | 18 | + <TouchableOpacity style={styles.header}> |
| 17 | - 我的 | 19 | + <View style={styles.headerLeft}> |
| 18 | - </Text> | 20 | + <Image source={require("../../assets/Mine/iconpic1.png")} style={styles.mineIcon} /> |
| 21 | + <Text style={styles.mineName}>汉克斯</Text> | ||
| 22 | + </View> | ||
| 23 | + <Image source={require("../../assets/Mine/rightArrow_white.png")} style={styles.headerRight}/> | ||
| 24 | + </TouchableOpacity> | ||
| 25 | + <BarList style={styles.midContainer} /> | ||
| 26 | + <TouchableOpacity style={styles.loginOut}> | ||
| 27 | + <Text style={styles.loginOutText}>退出登录</Text> | ||
| 28 | + </TouchableOpacity> | ||
| 19 | </View> | 29 | </View> |
| 20 | ); | 30 | ); |
| 21 | } | 31 | } |
| 22 | } | 32 | } |
| 23 | 33 | ||
| 34 | +class BarList extends Component { | ||
| 35 | + render() { | ||
| 36 | + return ( | ||
| 37 | + <View> | ||
| 38 | + <ListItem title={"消息通知"} num={"11"} /> | ||
| 39 | + <ListItem title={"我的提问"} /> | ||
| 40 | + </View> | ||
| 41 | + ) | ||
| 42 | + } | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +class ListItem extends Component { | ||
| 46 | + render() { | ||
| 47 | + return ( | ||
| 48 | + <TouchableOpacity style={styles.itemContainer}> | ||
| 49 | + <View style={styles.itemLeft}> | ||
| 50 | + <Image style={styles.leftIcon} source={require("../../assets/tabbar/ic_circle_s.png")} /> | ||
| 51 | + {/* <Image style={styles.leftIcon} source={require("../../assets/Mine/iconpic1.png")} /> */} | ||
| 52 | + <Text style={styles.leftTitle}>{this.props.title}</Text> | ||
| 53 | + {this.props.num?<Text style={styles.leftNum}> ({this.props.num})</Text>:null} | ||
| 54 | + </View> | ||
| 55 | + <Image style={styles.itemRight} source={require("../../assets/Mine/rightArrow_gray.png")} /> | ||
| 56 | + </TouchableOpacity> | ||
| 57 | + ) | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | + | ||
| 24 | const styles = StyleSheet.create({ | 61 | const styles = StyleSheet.create({ |
| 25 | container: { | 62 | container: { |
| 26 | flex: 1, | 63 | flex: 1, |
| 27 | - justifyContent: 'center', | 64 | + justifyContent: "flex-start", |
| 28 | - alignItems: 'center', | 65 | + alignItems: "stretch", |
| 29 | - backgroundColor: '#F5FCFF', | 66 | + backgroundColor: "#EFEFEF", |
| 30 | - }, | 67 | + paddingTop: 64, |
| 31 | - welcome: { | 68 | + }, |
| 32 | - fontSize: 20, | 69 | + header: { |
| 33 | - textAlign: 'center', | 70 | + backgroundColor: "#1B9341", |
| 34 | - margin: 10, | 71 | + height: 78, |
| 72 | + flexDirection: "row", | ||
| 73 | + justifyContent: "space-between", | ||
| 74 | + paddingLeft: 13, | ||
| 75 | + paddingRight: 13, | ||
| 76 | + alignItems: "center", | ||
| 77 | + marginBottom: 10, | ||
| 78 | + }, | ||
| 79 | + headerLeft: { | ||
| 80 | + flexDirection: "row", | ||
| 81 | + justifyContent: "flex-start", | ||
| 82 | + alignItems: "center", | ||
| 83 | + }, | ||
| 84 | + mineIcon: { | ||
| 85 | + width: 46, | ||
| 86 | + height: 46, | ||
| 87 | + marginRight: 14 | ||
| 88 | + }, | ||
| 89 | + mineName: { | ||
| 90 | + fontSize: 16, | ||
| 91 | + lineHeight: 22, | ||
| 92 | + color: "#fff" | ||
| 93 | + }, | ||
| 94 | + headerRight: { | ||
| 95 | + width: 14, | ||
| 96 | + height: 14, | ||
| 97 | + }, | ||
| 98 | + midContainer: { | ||
| 99 | + // marginTop: 10, | ||
| 100 | + // marginBottom: 10, | ||
| 101 | + // height: 92, | ||
| 102 | + }, | ||
| 103 | + itemContainer: { | ||
| 104 | + height: 46, | ||
| 105 | + paddingLeft: 16, | ||
| 106 | + paddingRight: 16, | ||
| 107 | + flexDirection: "row", | ||
| 108 | + justifyContent: "space-between", | ||
| 109 | + alignItems: "center", | ||
| 110 | + backgroundColor: "#fff", | ||
| 111 | + borderStyle: "solid", | ||
| 112 | + borderColor: "#F0F0F0", | ||
| 113 | + borderBottomWidth: 1, | ||
| 114 | + }, | ||
| 115 | + itemLeft: { | ||
| 116 | + flexDirection: "row", | ||
| 117 | + justifyContent: "flex-start", | ||
| 118 | + alignItems: "center", | ||
| 119 | + }, | ||
| 120 | + leftIcon: { | ||
| 121 | + marginRight: 11, | ||
| 122 | + width: 16, | ||
| 123 | + height: 16, | ||
| 124 | + }, | ||
| 125 | + leftTitle: { | ||
| 126 | + fontSize: 15, | ||
| 127 | + color: "#242424" | ||
| 128 | + }, | ||
| 129 | + leftNum: { | ||
| 130 | + fontSize: 15, | ||
| 131 | + color: "#EE6723" | ||
| 132 | + }, | ||
| 133 | + itemRight: { | ||
| 134 | + width: 14, | ||
| 135 | + height: 14, | ||
| 136 | + }, | ||
| 137 | + loginOut: { | ||
| 138 | + marginTop: 10, | ||
| 139 | + height: 46, | ||
| 140 | + backgroundColor: "#fff", | ||
| 141 | + justifyContent: "center", | ||
| 142 | + }, | ||
| 143 | + loginOutText: { | ||
| 144 | + textAlign: "center", | ||
| 145 | + fontSize: 15, | ||
| 35 | }, | 146 | }, |
| 36 | }); | 147 | }); |
| 37 | 148 |
| @@ -30,6 +30,7 @@ export default class Main extends Component { | @@ -30,6 +30,7 @@ export default class Main extends Component { | ||
| 30 | <TabBarIOS tintColor="#08CC6A" barTintColor="white"> | 30 | <TabBarIOS tintColor="#08CC6A" barTintColor="white"> |
| 31 | <TabBarIOS.Item | 31 | <TabBarIOS.Item |
| 32 | title="首页" | 32 | title="首页" |
| 33 | + icon={require("../assets/tabbar/ic_home_n.png")} | ||
| 33 | selected={this.state.selectedItem == "home"} | 34 | selected={this.state.selectedItem == "home"} |
| 34 | onPress={() => { | 35 | onPress={() => { |
| 35 | this.setState({ | 36 | this.setState({ |
| @@ -43,10 +44,12 @@ export default class Main extends Component { | @@ -43,10 +44,12 @@ export default class Main extends Component { | ||
| 43 | component: Home, | 44 | component: Home, |
| 44 | title: "保护神" | 45 | title: "保护神" |
| 45 | }} | 46 | }} |
| 47 | + | ||
| 46 | /> | 48 | /> |
| 47 | </TabBarIOS.Item> | 49 | </TabBarIOS.Item> |
| 48 | <TabBarIOS.Item | 50 | <TabBarIOS.Item |
| 49 | title="保圈" | 51 | title="保圈" |
| 52 | + icon={require("../assets/tabbar/ic_circle_n.png")} | ||
| 50 | selected={this.state.selectedItem == "insuranceCircle"} | 53 | selected={this.state.selectedItem == "insuranceCircle"} |
| 51 | onPress={() => { | 54 | onPress={() => { |
| 52 | this.setState({ | 55 | this.setState({ |
| @@ -64,6 +67,7 @@ export default class Main extends Component { | @@ -64,6 +67,7 @@ export default class Main extends Component { | ||
| 64 | </TabBarIOS.Item> | 67 | </TabBarIOS.Item> |
| 65 | <TabBarIOS.Item | 68 | <TabBarIOS.Item |
| 66 | title="保堂" | 69 | title="保堂" |
| 70 | + icon={require("../assets/tabbar/ic_umbrella_n.png")} | ||
| 67 | selected={this.state.selectedItem == "insuranceChurch"} | 71 | selected={this.state.selectedItem == "insuranceChurch"} |
| 68 | onPress={() => { | 72 | onPress={() => { |
| 69 | this.setState({ | 73 | this.setState({ |
| @@ -81,6 +85,7 @@ export default class Main extends Component { | @@ -81,6 +85,7 @@ export default class Main extends Component { | ||
| 81 | </TabBarIOS.Item> | 85 | </TabBarIOS.Item> |
| 82 | <TabBarIOS.Item | 86 | <TabBarIOS.Item |
| 83 | title="我的" | 87 | title="我的" |
| 88 | + icon={require("../assets/tabbar/ic_mine_n.png")} | ||
| 84 | selected={this.state.selectedItem == "mine"} | 89 | selected={this.state.selectedItem == "mine"} |
| 85 | onPress={() => { | 90 | onPress={() => { |
| 86 | this.setState({ | 91 | this.setState({ |
-
Please register or login to post a comment