content: /**
   * Sample React Native App
   * https://github.com/facebook/react-native
   * @flow
   */
  
  import React, { Component } from 'react';
  import {
    StyleSheet,
    Text,
    View,
    Navigator,
    Platform,
    WebView,
  } from 'react-native';
  
  const DEFAULT_URL_COMMUNITY = 'https://sale.suning.com/znjj2/sns/1/sns.html?source=smart';
  
  export default class Community extends Component {
  
    constructor(props) {
      super(props);
  
      this.state = {
  
      };
    }
  
    requestShould(request){
      console.log(request.url);
      var url = request.url.indexOf('jsbridge:');
      if (url >= 0) {
        console.log('has contain jsbridge  '+ url);
        return false;
      }
      return true;
    }
  
    render() {
      return (<View style={styles.container}>
        <WebView style={styles.webView}
          source={{uri:DEFAULT_URL_COMMUNITY}}
          startInLoadingState={true}
          javaScriptEnabled={false}
          onLoad={()=>alert('加载成功')}
          onShouldStartLoadWithRequest ={(request)=>this.requestShould(request)}>
        </WebView>
        </View>
      );
    }
  }
  
  const styles = StyleSheet.create({
    container:{
      backgroundColor: '#ffffff',
            flex: 1
    },
    webView:{
      flex:1,
      backgroundColor:'#ffffff',
    }
  });
  