罗广聪

不知道改了啥,反正首页列表右边padding样式没解决,最好用上一个版本

... ... @@ -6,7 +6,8 @@ import {
View,
Image,
TouchableOpacity,
ScrollView
ScrollView,
FlatList
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
import Swiper from "react-native-swiper";
... ... @@ -25,53 +26,60 @@ export default class Home extends Component {
ListData: [
{
title: "重疾、大病和防癌险,傻傻分不清?",
key: 1,
context: "重疾险、大病保险和防癌险,这几大险种你能分得清吗?",
url:
"http://mp.weixin.qq.com/s/vSz_WuGpPYNMNpGQv-zxAQ",
// context: "重疾险、大病保险和防癌险,这几大险...",
url: "http://mp.weixin.qq.com/s/vSz_WuGpPYNMNpGQv-zxAQ",
imgurl: require("../../assets/home/Headlines_重疾险.png")
},
{
title: "想为家里老人买份保险,怎么选?",
key: 2,
context: "在如今的商业保险中,老年人的保险成为了很多人比较纠结的问题。",
url:
"http://mp.weixin.qq.com/s/R_KuAzEVQCVKj7FUOzuHJw",
// context: "在如今的商业保险中,老年人的保险成...",
url: "http://mp.weixin.qq.com/s/R_KuAzEVQCVKj7FUOzuHJw",
imgurl: require("../../assets/home/Headlines_中老年医疗险.png")
},
{
title: "驾车远行需要做哪些保险准备?",
key: 3,
context: "出行前我们需要做哪些准备工作,才能避免发生事故后的束手无策?",
url:
"http://mp.weixin.qq.com/s/Tkm4TrBEXqXJzC4FQdW2MQ",
// context: "出行前我们需要做哪些准备工作,才能...",
url: "http://mp.weixin.qq.com/s/Tkm4TrBEXqXJzC4FQdW2MQ",
imgurl: require("../../assets/home/Headlines_出驾远行.png")
},
{
title: "选购儿童险,这几大原则也应注意!",
key: 4,
context: "认真对待关于孩子的保险问题,还需要注意投保时候的一些原则。",
// context: "认真对待关于孩子的保险问题,还需...",
url: "http://mp.weixin.qq.com/s/iUEiBMik_3WMuxnAPFDXXQ",
imgurl: require("../../assets/home/Headlines_儿童险.png")
},
{
title: "关于重疾险,这几个关键问题也需了解!",
title: "重疾险这几个关键问题也需了解!",
key: 5,
context: "作为咨询热度较高的险种,很多人对重疾险有着不同的疑问。",
// context: "作为咨询热度较高的险种,很多人对重...",
url: "http://mp.weixin.qq.com/s/VP-0BcBTvipbuq9bgOZ0NQ",
imgurl: require("../../assets/home/Headlines_意外险.png")
}
],
swiperImgList: [
{
img: require("../../assets/home/slider_1.jpeg"),
img: require("../../assets/home/slider_1.jpeg")
// url: "https://www.baidu.com/"
},
{
img: require("../../assets/home/slider_2.jpeg"),
img: require("../../assets/home/slider_2.jpeg")
// url: "https://www.baidu.com/"
},
{
img: require("../../assets/home/slider_3.jpeg"),
img: require("../../assets/home/slider_3.jpeg")
// url: "https://www.baidu.com/"
},
]
}
]
};
}
componentDidMount() {
console.log("thisprops", this.props);
... ... @@ -85,10 +93,16 @@ export default class Home extends Component {
key={index}
onPress={() => navigate("CommonWebView", { item: item })}
>
<Image style={styles.itemImgWrapper} source={item.imgurl} />
<View style={styles.itemImgWrapper}>
<Image source={item.imgurl} style={{ width: 74, height: 74 }} />
</View>
<View style={styles.itemRightWrapper}>
<Text style={styles.itemTextTop} numberOfLines={1}>{item.title}</Text>
<Text style={styles.itemTextBottom} numberOfLines={1}>{item.context}</Text>
<Text style={styles.itemTextTop} numberOfLines={1}>
{item.title}
</Text>
<Text style={styles.itemTextBottom} numberOfLines={1}>
{item.context}
</Text>
</View>
</TouchableOpacity>
);
... ... @@ -105,7 +119,7 @@ export default class Home extends Component {
height={120}
dotStyle={{
width: 6,
height: 6,
height: 6
}}
activeDotStyle={{
width: 6,
... ... @@ -117,10 +131,7 @@ export default class Home extends Component {
/* console.log("图片item",item); */
}
return (
<TouchableOpacity
style={styles.slide}
key={index}
>
<TouchableOpacity style={styles.slide} key={index}>
<Image
style={styles.slideImg}
source={item.img}
... ... @@ -141,9 +152,7 @@ export default class Home extends Component {
{this._swiper()}
<TouchableOpacity
style={styles.midContainer}
onPress={() =>
navigate("AllProduct")
}
onPress={() => navigate("AllProduct")}
>
<Image
source={require("../../assets/home/pic.png")}
... ... @@ -162,7 +171,34 @@ export default class Home extends Component {
style={styles.listContainer}
automaticallyAdjustContentInsets={false}
>
{this._renderMap()}
{this.state.ListData.map((item, index) => {
return (
<TouchableOpacity
style={styles.itemContainer}
key={index}
onPress={() => navigate("CommonWebView", { item: item })}
>
<View style={styles.itemImgWrapper}>
<Image
source={item.imgurl}
style={{ width: 74, height: 74 }}
/>
</View>
<View style={styles.itemRightWrapper}>
<View style={styles.textWrapper}>
<Text style={styles.itemTextTop} numberOfLines={1}>
{item.title}
</Text>
</View>
<View style={styles.textWrapper}>
<Text style={styles.itemTextBottom} numberOfLines={1}>
{item.context}
</Text>
</View>
</View>
</TouchableOpacity>
);
})}
<Text style={styles.scrollViewText}>没有更多了</Text>
</ScrollView>
</View>
... ... @@ -173,7 +209,6 @@ export default class Home extends Component {
const styles = StyleSheet.create({
container: {
flex: 1,
// paddingTop: 64,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF"
... ... @@ -186,8 +221,8 @@ const styles = StyleSheet.create({
backgroundColor: "#92BBD9"
},
slideImg: {
flex: 1,
height: 140
flex: 1
// height: 140,
},
midContainer: {
height: 45,
... ... @@ -229,17 +264,19 @@ const styles = StyleSheet.create({
borderTopColor: "#EEEEEE",
borderStyle: "solid",
paddingLeft: 13,
paddingRight: 13
// paddingRight: 13
},
itemImgWrapper: {
width: 74,
height: 66,
marginRight: 12
},
itemRightWrapper: {
justifyContent: "center",
height: 66,
flex: 1
flex: 1,
justifyContent: "center"
// paddingRight: 50
},
textWrapper: {
paddingRight: 13
},
itemTextTop: {
fontSize: 16,
... ...
... ... @@ -94,9 +94,7 @@ const styles = StyleSheet.create({
backgroundColor: "#EFEFEF",
},
scrollViewContainer: {
// height: 300
flex: 1,
marginBottom: 49,
},
scrollViewText: {
color: "#7A7A7A",
... ...
... ... @@ -234,7 +234,6 @@ export default class Login extends Component {
console.error(err);
}
console.log("点击登录后的值",result)
that.setState({
IS_LOGIN: result[0][1],
USER_ID: (result[1][1] != null) ? result[1][1] : "",
... ...