罗广聪

全部产品页面无法跳转

@@ -3,6 +3,8 @@ import { @@ -3,6 +3,8 @@ import {
3 StyleSheet, 3 StyleSheet,
4 WebView, 4 WebView,
5 View, 5 View,
  6 + Image,
  7 + Dimensions
6 } from 'react-native'; 8 } from 'react-native';
7 import { StackNavigator, TabNavigator } from 'react-navigation'; 9 import { StackNavigator, TabNavigator } from 'react-navigation';
8 10
@@ -13,6 +15,7 @@ export default class CommonWebview extends Component { @@ -13,6 +15,7 @@ export default class CommonWebview extends Component {
13 } 15 }
14 render() { 16 render() {
15 console.log("url",this.props) 17 console.log("url",this.props)
  18 + const url = this.props.navigation.state.params.item.url;
16 return ( 19 return (
17 <WebView 20 <WebView
18 style={styles.container} 21 style={styles.container}
@@ -29,6 +32,11 @@ const styles = StyleSheet.create({ @@ -29,6 +32,11 @@ const styles = StyleSheet.create({
29 paddingTop: 64, 32 paddingTop: 64,
30 justifyContent: "flex-start", 33 justifyContent: "flex-start",
31 alignItems: "stretch", 34 alignItems: "stretch",
32 - backgroundColor: "#EFEFEF" 35 + backgroundColor: "#EFEFEF",
  36 + paddingLeft: 10,
  37 + paddingRight: 10,
33 }, 38 },
  39 + // img: {
  40 + // width: Dimensions.get("window").width - 20,
  41 + // },
34 }); 42 });
@@ -21,12 +21,14 @@ export default class AllProduct extends Component { @@ -21,12 +21,14 @@ export default class AllProduct extends Component {
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_long_1.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_long_1.jpg"),
30 imgurl: require("../../assets/home/product_2.png") 32 imgurl: require("../../assets/home/product_2.png")
31 }, 33 },
32 ] 34 ]
@@ -35,6 +37,7 @@ export default class AllProduct extends Component { @@ -35,6 +37,7 @@ export default class AllProduct extends Component {
35 37
36 render() { 38 render() {
37 const { navigate } = this.props.navigation; 39 const { navigate } = this.props.navigation;
  40 + {/* onPress={() => navigate("CommonWebview", { item: item })} */}
38 return ( 41 return (
39 <View style={styles.container}> 42 <View style={styles.container}>
40 <ScrollView 43 <ScrollView