罗广聪

安卓分支

... ... @@ -16,6 +16,7 @@ import Login from "./src/pages/Login";
import AllProduct from "./src/pages/Home/allProduct";
import CommonWebView from "./src/Components/CommonWebView";
import Details from "./src/pages/InsuranceCircle/details";
import AllProductImg from "./src/pages/Home/allProductImg";
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
const MainTabBar = TabNavigator({
... ... @@ -87,10 +88,12 @@ const ProtectGod = StackNavigator(
navigationOptions: { headerTitle: "全部产品" }
},
CommonWebView: { screen: CommonWebView },
Details: { screen: Details }
Details: { screen: Details },
AllProductImg: { screen: AllProductImg }
},{
navigationOptions: {
// headerTintColor: "blue",
headerBackTitle:'返回',
headerStyle: {
backgroundColor: "white"
}
... ...
... ... @@ -17,6 +17,7 @@ export default class CommonWebview extends Component {
<WebView
style={styles.container}
source={{uri: this.props.navigation.state.params.item.url}}
startInLoadingState={true}
/>
);
}
... ...
... ... @@ -20,13 +20,15 @@ export default class AllProduct extends Component {
{
title: "平安e生保2017版-100万(有社保含新农合)",
time: "刚刚",
url: "http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html",
// url: "http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html",
url: require("../../assets/home/product_long1.jpg"),
imgurl: require("../../assets/home/product_1.png")
},
{
title: "泰康在线“住院宝”必备版(0-49周岁)",
time: "刚刚",
url: "http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html",
// url: "http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html",
url: require("../../assets/home/product_long2.jpg"),
imgurl: require("../../assets/home/product_2.png")
},
]
... ... @@ -47,7 +49,7 @@ export default class AllProduct extends Component {
<TouchableOpacity
style={styles.itemContainer}
key={index}
onPress={() => navigate("CommonWebView", { item: item })}
onPress={() => navigate("AllProductImg", { item: item })}
>
<Image style={styles.itemImgWrapper} source={item.imgurl} />
<View style={styles.itemRightWrapper}>
... ...
import React, { Component } from "react";
import {
StyleSheet,
Text,
View,
Image,
TouchableOpacity,
ScrollView,
Dimensions
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
export default class allProductImg extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
console.log("图片产品的thisprops", this.props);
}
render() {
const url = this.props.navigation.state.params.item.url;
console.log(this.props.navigation.state.params.item);
return (
<View style={styles.container}>
<ScrollView style={styles.sccontainer}>
<Image source={url} style={styles.img} resizeMode="contain" />
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
// justifyContent: "flex-start",
backgroundColor: "#EFEFEF",
paddingTop: 20,
paddingLeft: 10,
paddingRight: 10
},
sccontainer: {
flex: 1,
justifyContent: "flex-start"
},
img: {
width: Dimensions.get("window").width - 20
}
});
... ...
... ... @@ -177,10 +177,10 @@ export default class Mine extends Component {
}}
>
<View style={styles.itemLeft}>
<Image
{/* <Image
style={styles.leftIcon}
source={require("../../assets/tabbar/ic_circle_s.png")}
/>
/> */}
<Text style={styles.leftTitle}>设置昵称</Text>
</View>
<View style={styles.itemRight}>
... ... @@ -207,10 +207,10 @@ export default class Mine extends Component {
}}
>
<View style={styles.itemLeft}>
<Image
{/* <Image
style={styles.leftIcon}
source={require("../../assets/tabbar/ic_circle_s.png")}
/>
/> */}
<Text style={styles.leftTitle}>设置职业</Text>
</View>
<View style={styles.itemRight}>
... ...