罗广聪

安卓分支

@@ -16,6 +16,7 @@ import Login from "./src/pages/Login"; @@ -16,6 +16,7 @@ import Login from "./src/pages/Login";
16 import AllProduct from "./src/pages/Home/allProduct"; 16 import AllProduct from "./src/pages/Home/allProduct";
17 import CommonWebView from "./src/Components/CommonWebView"; 17 import CommonWebView from "./src/Components/CommonWebView";
18 import Details from "./src/pages/InsuranceCircle/details"; 18 import Details from "./src/pages/InsuranceCircle/details";
  19 +import AllProductImg from "./src/pages/Home/allProductImg";
19 20
20 // 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面 21 // 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
21 const MainTabBar = TabNavigator({ 22 const MainTabBar = TabNavigator({
@@ -87,10 +88,12 @@ const ProtectGod = StackNavigator( @@ -87,10 +88,12 @@ const ProtectGod = StackNavigator(
87 navigationOptions: { headerTitle: "全部产品" } 88 navigationOptions: { headerTitle: "全部产品" }
88 }, 89 },
89 CommonWebView: { screen: CommonWebView }, 90 CommonWebView: { screen: CommonWebView },
90 - Details: { screen: Details } 91 + Details: { screen: Details },
  92 + AllProductImg: { screen: AllProductImg }
91 },{ 93 },{
92 navigationOptions: { 94 navigationOptions: {
93 // headerTintColor: "blue", 95 // headerTintColor: "blue",
  96 + headerBackTitle:'返回',
94 headerStyle: { 97 headerStyle: {
95 backgroundColor: "white" 98 backgroundColor: "white"
96 } 99 }
@@ -17,6 +17,7 @@ export default class CommonWebview extends Component { @@ -17,6 +17,7 @@ export default class CommonWebview extends Component {
17 <WebView 17 <WebView
18 style={styles.container} 18 style={styles.container}
19 source={{uri: this.props.navigation.state.params.item.url}} 19 source={{uri: this.props.navigation.state.params.item.url}}
  20 + startInLoadingState={true}
20 /> 21 />
21 ); 22 );
22 } 23 }
@@ -20,13 +20,15 @@ export default class AllProduct extends Component { @@ -20,13 +20,15 @@ export default class AllProduct extends Component {
20 { 20 {
21 title: "平安e生保2017版-100万(有社保含新农合)", 21 title: "平安e生保2017版-100万(有社保含新农合)",
22 time: "刚刚", 22 time: "刚刚",
23 - url: "http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html", 23 + // url: "http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html",
  24 + url: require("../../assets/home/product_long1.jpg"),
24 imgurl: require("../../assets/home/product_1.png") 25 imgurl: require("../../assets/home/product_1.png")
25 }, 26 },
26 { 27 {
27 title: "泰康在线“住院宝”必备版(0-49周岁)", 28 title: "泰康在线“住院宝”必备版(0-49周岁)",
28 time: "刚刚", 29 time: "刚刚",
29 - url: "http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html", 30 + // url: "http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html",
  31 + url: require("../../assets/home/product_long2.jpg"),
30 imgurl: require("../../assets/home/product_2.png") 32 imgurl: require("../../assets/home/product_2.png")
31 }, 33 },
32 ] 34 ]
@@ -47,7 +49,7 @@ export default class AllProduct extends Component { @@ -47,7 +49,7 @@ export default class AllProduct extends Component {
47 <TouchableOpacity 49 <TouchableOpacity
48 style={styles.itemContainer} 50 style={styles.itemContainer}
49 key={index} 51 key={index}
50 - onPress={() => navigate("CommonWebView", { item: item })} 52 + onPress={() => navigate("AllProductImg", { item: item })}
51 > 53 >
52 <Image style={styles.itemImgWrapper} source={item.imgurl} /> 54 <Image style={styles.itemImgWrapper} source={item.imgurl} />
53 <View style={styles.itemRightWrapper}> 55 <View style={styles.itemRightWrapper}>
  1 +import React, { Component } from "react";
  2 +import {
  3 + StyleSheet,
  4 + Text,
  5 + View,
  6 + Image,
  7 + TouchableOpacity,
  8 + ScrollView,
  9 + Dimensions
  10 +} from "react-native";
  11 +import { StackNavigator, TabNavigator } from "react-navigation";
  12 +
  13 +export default class allProductImg extends Component {
  14 + constructor(props) {
  15 + super(props);
  16 + this.state = {};
  17 + }
  18 + componentDidMount() {
  19 + console.log("图片产品的thisprops", this.props);
  20 + }
  21 +
  22 + render() {
  23 + const url = this.props.navigation.state.params.item.url;
  24 + console.log(this.props.navigation.state.params.item);
  25 + return (
  26 + <View style={styles.container}>
  27 + <ScrollView style={styles.sccontainer}>
  28 + <Image source={url} style={styles.img} resizeMode="contain" />
  29 + </ScrollView>
  30 + </View>
  31 + );
  32 + }
  33 +}
  34 +
  35 +const styles = StyleSheet.create({
  36 + container: {
  37 + flex: 1,
  38 + // justifyContent: "flex-start",
  39 + backgroundColor: "#EFEFEF",
  40 + paddingTop: 20,
  41 + paddingLeft: 10,
  42 + paddingRight: 10
  43 + },
  44 + sccontainer: {
  45 + flex: 1,
  46 + justifyContent: "flex-start"
  47 + },
  48 + img: {
  49 + width: Dimensions.get("window").width - 20
  50 + }
  51 +});
@@ -177,10 +177,10 @@ export default class Mine extends Component { @@ -177,10 +177,10 @@ export default class Mine extends Component {
177 }} 177 }}
178 > 178 >
179 <View style={styles.itemLeft}> 179 <View style={styles.itemLeft}>
180 - <Image 180 + {/* <Image
181 style={styles.leftIcon} 181 style={styles.leftIcon}
182 source={require("../../assets/tabbar/ic_circle_s.png")} 182 source={require("../../assets/tabbar/ic_circle_s.png")}
183 - /> 183 + /> */}
184 <Text style={styles.leftTitle}>设置昵称</Text> 184 <Text style={styles.leftTitle}>设置昵称</Text>
185 </View> 185 </View>
186 <View style={styles.itemRight}> 186 <View style={styles.itemRight}>
@@ -207,10 +207,10 @@ export default class Mine extends Component { @@ -207,10 +207,10 @@ export default class Mine extends Component {
207 }} 207 }}
208 > 208 >
209 <View style={styles.itemLeft}> 209 <View style={styles.itemLeft}>
210 - <Image 210 + {/* <Image
211 style={styles.leftIcon} 211 style={styles.leftIcon}
212 source={require("../../assets/tabbar/ic_circle_s.png")} 212 source={require("../../assets/tabbar/ic_circle_s.png")}
213 - /> 213 + /> */}
214 <Text style={styles.leftTitle}>设置职业</Text> 214 <Text style={styles.leftTitle}>设置职业</Text>
215 </View> 215 </View>
216 <View style={styles.itemRight}> 216 <View style={styles.itemRight}>