Showing
5 changed files
with
131 additions
and
59 deletions
| @@ -75,6 +75,7 @@ export default class AllProduct extends Component { | @@ -75,6 +75,7 @@ export default class AllProduct extends Component { | ||
| 75 | </TouchableOpacity> | 75 | </TouchableOpacity> |
| 76 | ); | 76 | ); |
| 77 | })} | 77 | })} |
| 78 | + <Text style={styles.scrollViewText}>没有更多了</Text> | ||
| 78 | </ScrollView> | 79 | </ScrollView> |
| 79 | </View> | 80 | </View> |
| 80 | ); | 81 | ); |
| @@ -105,6 +105,7 @@ export default class Home extends Component { | @@ -105,6 +105,7 @@ export default class Home extends Component { | ||
| 105 | automaticallyAdjustContentInsets={false} | 105 | automaticallyAdjustContentInsets={false} |
| 106 | > | 106 | > |
| 107 | {this._renderMap()} | 107 | {this._renderMap()} |
| 108 | + <Text style={styles.scrollViewText}>没有更多了</Text> | ||
| 108 | </ScrollView> | 109 | </ScrollView> |
| 109 | </View> | 110 | </View> |
| 110 | ); | 111 | ); |
| @@ -177,5 +178,11 @@ const styles = StyleSheet.create({ | @@ -177,5 +178,11 @@ const styles = StyleSheet.create({ | ||
| 177 | fontSize: 13, | 178 | fontSize: 13, |
| 178 | color: "#7A7A7A", | 179 | color: "#7A7A7A", |
| 179 | lineHeight: 18 | 180 | lineHeight: 18 |
| 180 | - } | 181 | + }, |
| 182 | + scrollViewText: { | ||
| 183 | + color: "#7A7A7A", | ||
| 184 | + fontSize: 13, | ||
| 185 | + marginTop: 10, | ||
| 186 | + textAlign: "center" | ||
| 187 | + }, | ||
| 181 | }); | 188 | }); |
| @@ -47,7 +47,6 @@ export default class InsuranceChurch extends Component { | @@ -47,7 +47,6 @@ export default class InsuranceChurch extends Component { | ||
| 47 | render() { | 47 | render() { |
| 48 | return ( | 48 | return ( |
| 49 | <View style={styles.container}> | 49 | <View style={styles.container}> |
| 50 | - {/* <NewsList /> */} | ||
| 51 | <ScrollView | 50 | <ScrollView |
| 52 | style={styles.scrollViewContainer} | 51 | style={styles.scrollViewContainer} |
| 53 | automaticallyAdjustContentInsets={false} | 52 | automaticallyAdjustContentInsets={false} |
| @@ -76,6 +75,7 @@ export default class InsuranceChurch extends Component { | @@ -76,6 +75,7 @@ export default class InsuranceChurch extends Component { | ||
| 76 | </TouchableOpacity> | 75 | </TouchableOpacity> |
| 77 | ); | 76 | ); |
| 78 | })} | 77 | })} |
| 78 | + <Text style={styles.scrollViewText}>没有更多了</Text> | ||
| 79 | </ScrollView> | 79 | </ScrollView> |
| 80 | </View> | 80 | </View> |
| 81 | ); | 81 | ); |
| @@ -92,7 +92,6 @@ const styles = StyleSheet.create({ | @@ -92,7 +92,6 @@ const styles = StyleSheet.create({ | ||
| 92 | }, | 92 | }, |
| 93 | scrollViewContainer: { | 93 | scrollViewContainer: { |
| 94 | height: 300 | 94 | height: 300 |
| 95 | - // backgroundColor: "red" | ||
| 96 | }, | 95 | }, |
| 97 | scrollViewText: { | 96 | scrollViewText: { |
| 98 | color: "#7A7A7A", | 97 | color: "#7A7A7A", |
src/pages/InsuranceCircle/details.js
0 → 100644
| 1 | + | ||
| 2 | +import React, { Component } from 'react'; | ||
| 3 | +import { | ||
| 4 | + AppRegistry, | ||
| 5 | + StyleSheet, | ||
| 6 | + Text, | ||
| 7 | + View, | ||
| 8 | + ScrollView, | ||
| 9 | + TouchableOpacity, | ||
| 10 | + Image, | ||
| 11 | +} from 'react-native'; | ||
| 12 | + | ||
| 13 | +export default class Details extends Component { | ||
| 14 | + constructor(props) { | ||
| 15 | + super(props); | ||
| 16 | + this.state = {} | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + render() { | ||
| 20 | + return ( | ||
| 21 | + <View style={styles.container}> | ||
| 22 | + <Text>我是详情页</Text> | ||
| 23 | + </View> | ||
| 24 | + ); | ||
| 25 | + } | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +const styles = StyleSheet.create({ | ||
| 29 | + container: { | ||
| 30 | + flex: 1, | ||
| 31 | + justifyContent: "flex-start", | ||
| 32 | + alignItems: "stretch", | ||
| 33 | + backgroundColor: "#EFEFEF", | ||
| 34 | + paddingTop: 74, | ||
| 35 | + }, | ||
| 36 | +}) | ||
| 37 | + |
| 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,71 +7,101 @@ import { | @@ -8,71 +7,101 @@ import { | ||
| 8 | ScrollView, | 7 | ScrollView, |
| 9 | TouchableOpacity, | 8 | TouchableOpacity, |
| 10 | Image | 9 | Image |
| 11 | -} from 'react-native'; | 10 | +} from "react-native"; |
| 12 | import CommonWebView from "../../Components/CommonWebView"; | 11 | import CommonWebView from "../../Components/CommonWebView"; |
| 12 | +import Details from "./details"; | ||
| 13 | 13 | ||
| 14 | export default class InsuranceCircle extends Component { | 14 | export default class InsuranceCircle extends Component { |
| 15 | + constructor(props) { | ||
| 16 | + super(props); | ||
| 17 | + this.state = { | ||
| 18 | + ListData: [ | ||
| 19 | + { | ||
| 20 | + title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…", | ||
| 21 | + content: | ||
| 22 | + "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…", | ||
| 23 | + name: "jack", | ||
| 24 | + image: require("../../assets/circle/newspic.png"), | ||
| 25 | + num: "30", | ||
| 26 | + comments: [] | ||
| 27 | + }, | ||
| 28 | + { | ||
| 29 | + title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…", | ||
| 30 | + content: | ||
| 31 | + "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…", | ||
| 32 | + name: "mike", | ||
| 33 | + image: require("../../assets/circle/newspic.png"), | ||
| 34 | + num: "29", | ||
| 35 | + comments: [] | ||
| 36 | + }, | ||
| 37 | + { | ||
| 38 | + title: "因为你病不起,输不起,也折腾不起…", | ||
| 39 | + content: | ||
| 40 | + "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…", | ||
| 41 | + name: "luosf", | ||
| 42 | + image: require("../../assets/circle/newspic.png"), | ||
| 43 | + num: "10", | ||
| 44 | + comments: [] | ||
| 45 | + } | ||
| 46 | + ] | ||
| 47 | + }; | ||
| 48 | + } | ||
| 49 | + | ||
| 15 | render() { | 50 | render() { |
| 16 | return ( | 51 | return ( |
| 17 | <View style={styles.container}> | 52 | <View style={styles.container}> |
| 18 | - <NewsList jumP={() => {this.props.navigator.push({component:CommonWebView,title:"hjjj",rightButtonTitle: 'Cancel',})}} /> | 53 | + <ScrollView |
| 54 | + style={styles.scrollViewContainer} | ||
| 55 | + automaticallyAdjustContentInsets={false} | ||
| 56 | + > | ||
| 57 | + {this.state.ListData.map((item, index) => { | ||
| 58 | + return ( | ||
| 59 | + <TouchableOpacity | ||
| 60 | + style={styles.itemContainer} | ||
| 61 | + key={index} | ||
| 62 | + onPress={() => { | ||
| 63 | + this.props.navigator.push({ | ||
| 64 | + component: Details, | ||
| 65 | + passProps: {} | ||
| 66 | + }); | ||
| 67 | + }} | ||
| 68 | + > | ||
| 69 | + <Text style={styles.itemTitle} numberOfLines={2}> | ||
| 70 | + {item.title} | ||
| 71 | + </Text> | ||
| 72 | + <Text style={styles.itemContent} numberOfLines={3}> | ||
| 73 | + {item.content} | ||
| 74 | + </Text> | ||
| 75 | + <View style={styles.itemInfoWrapper}> | ||
| 76 | + <View style={styles.itemInfoLeft}> | ||
| 77 | + <Image | ||
| 78 | + source={item.image} | ||
| 79 | + style={[styles.itemInfoIcon, { width: 26, height: 26 }]} | ||
| 80 | + /> | ||
| 81 | + <Text style={styles.itemInfoName}>{item.name}</Text> | ||
| 82 | + </View> | ||
| 83 | + <Text style={styles.itemInfoRight}>{item.num} 评论</Text> | ||
| 84 | + </View> | ||
| 85 | + </TouchableOpacity> | ||
| 86 | + ); | ||
| 87 | + })} | ||
| 88 | + <Text style={styles.scrollViewText}>没有更多了</Text> | ||
| 89 | + </ScrollView> | ||
| 19 | </View> | 90 | </View> |
| 20 | ); | 91 | ); |
| 21 | } | 92 | } |
| 22 | } | 93 | } |
| 23 | 94 | ||
| 24 | -class NewsList extends Component { | ||
| 25 | - render() { | ||
| 26 | - return ( | ||
| 27 | - <ScrollView style={styles.scrollViewContainer} automaticallyAdjustContentInsets={false}> | ||
| 28 | - <ListItem | ||
| 29 | - jump={this.props.jumP} | ||
| 30 | - title={"家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…"} | ||
| 31 | - content={"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…"} | ||
| 32 | - name={"汉克斯"} | ||
| 33 | - num={"30"} | ||
| 34 | - /> | ||
| 35 | - <ListItem | ||
| 36 | - title={"家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…"} | ||
| 37 | - content={"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…"} | ||
| 38 | - name={"汉克斯"} | ||
| 39 | - num={"30"} | ||
| 40 | - /> | ||
| 41 | - <Text style={styles.scrollViewText}>没有更多了</Text> | ||
| 42 | - </ScrollView> | ||
| 43 | - ) | ||
| 44 | - } | ||
| 45 | -} | ||
| 46 | - | ||
| 47 | -class ListItem extends Component { | ||
| 48 | - render() { | ||
| 49 | - return ( | ||
| 50 | - <TouchableOpacity style={styles.itemContainer} onPress={this.props.jump}> | ||
| 51 | - <Text style={styles.itemTitle} numberOfLines={2}>{this.props.title}</Text> | ||
| 52 | - <Text style={styles.itemContent} numberOfLines={3}>{this.props.content}</Text> | ||
| 53 | - <View style={styles.itemInfoWrapper}> | ||
| 54 | - <View style={styles.itemInfoLeft}> | ||
| 55 | - <Image source={require("../../assets/Mine/iconpic1.png")} style={[styles.itemInfoIcon,{width:26, height:26}]} /> | ||
| 56 | - {/* <View style={styles.itemInfoIcon}></View> */} | ||
| 57 | - <Text style={styles.itemInfoName}>{this.props.name}</Text> | ||
| 58 | - </View> | ||
| 59 | - <Text style={styles.itemInfoRight}>{this.props.num} 评论</Text> | ||
| 60 | - </View> | ||
| 61 | - </TouchableOpacity> | ||
| 62 | - ) | ||
| 63 | - } | ||
| 64 | -} | ||
| 65 | - | ||
| 66 | const styles = StyleSheet.create({ | 95 | const styles = StyleSheet.create({ |
| 67 | container: { | 96 | container: { |
| 68 | flex: 1, | 97 | flex: 1, |
| 69 | justifyContent: "flex-start", | 98 | justifyContent: "flex-start", |
| 70 | alignItems: "stretch", | 99 | alignItems: "stretch", |
| 71 | backgroundColor: "#EFEFEF", | 100 | backgroundColor: "#EFEFEF", |
| 72 | - paddingTop: 74, | 101 | + paddingTop: 74 |
| 73 | }, | 102 | }, |
| 74 | scrollViewContainer: { | 103 | scrollViewContainer: { |
| 75 | - height: 300, | 104 | + height: 300 |
| 76 | }, | 105 | }, |
| 77 | scrollViewText: { | 106 | scrollViewText: { |
| 78 | color: "#7A7A7A", | 107 | color: "#7A7A7A", |
| @@ -86,7 +115,7 @@ const styles = StyleSheet.create({ | @@ -86,7 +115,7 @@ const styles = StyleSheet.create({ | ||
| 86 | height: 180, | 115 | height: 180, |
| 87 | paddingLeft: 13, | 116 | paddingLeft: 13, |
| 88 | paddingRight: 13, | 117 | paddingRight: 13, |
| 89 | - paddingTop: 19, | 118 | + paddingTop: 19 |
| 90 | }, | 119 | }, |
| 91 | itemTitle: { | 120 | itemTitle: { |
| 92 | fontSize: 17, | 121 | fontSize: 17, |
| @@ -108,20 +137,19 @@ const styles = StyleSheet.create({ | @@ -108,20 +137,19 @@ const styles = StyleSheet.create({ | ||
| 108 | itemInfoLeft: { | 137 | itemInfoLeft: { |
| 109 | flexDirection: "row", | 138 | flexDirection: "row", |
| 110 | justifyContent: "flex-start", | 139 | justifyContent: "flex-start", |
| 111 | - alignItems: "center", | 140 | + alignItems: "center" |
| 112 | }, | 141 | }, |
| 113 | itemInfoIcon: { | 142 | itemInfoIcon: { |
| 114 | - marginRight: 10, | 143 | + marginRight: 10 |
| 115 | }, | 144 | }, |
| 116 | itemInfoName: { | 145 | itemInfoName: { |
| 117 | fontSize: 13, | 146 | fontSize: 13, |
| 118 | color: "#242424", | 147 | color: "#242424", |
| 119 | - lineHeight: 18, | 148 | + lineHeight: 18 |
| 120 | }, | 149 | }, |
| 121 | itemInfoRight: { | 150 | itemInfoRight: { |
| 122 | fontSize: 13, | 151 | fontSize: 13, |
| 123 | color: "#999999", | 152 | color: "#999999", |
| 124 | - lineHeight: 18, | 153 | + lineHeight: 18 |
| 125 | - }, | 154 | + } |
| 126 | -}) | 155 | +}); |
| 127 | - |
-
Please register or login to post a comment