import React, { Component } from 'react' import { StyleSheet, View, Platform, Text, Dimensions, StatusBar, TouchableOpacity, PixelRatio } from 'react-native' import {WebView} from 'react-native-webview'; import { connect } from 'react-redux' import Icon from '../../../components/Iconfont/Iconfont' import { ImageBaseUrl } from '../../../utils/fetch/Fetchx.js' import TopTab from '../../../components/toptab/TopTab' import { NavigationActions, ScaleUtil, createAction } from '../../../utils' import { compose } from 'redux' import { ReturnDate } from '../../../utils/utils' const { width, height } = Dimensions.get('window') @connect(({ theme }) => ({ ...theme })) class AnnounceDetail extends Component { constructor(props) { super(props) this.state = {} // console.disableYellowBox = true; } render() { console.log(WebView); const { appTheme } = this.props const { item } = this.props.navigation.state.params let html = item.content html = html ? html.replace( /src=\"\/g1\//g, `style="max-width:${width - 40}px; max-height:${height - 100}px;" src="${ImageBaseUrl}/g1/` ) : '' let html5 = ` ${html}` return ( {/* 头部 */} this.props.dispatch(NavigationActions.back())} > 返回 公告详情 {item.title} 发布时间:{ReturnDate(item.pubdate, true)} { this.setState({ WebViewHeight: info.url.replace('about:blank%23', '') / 1, }) }} /> ) } } const styles = StyleSheet.create({ container: { flex: 1, }, }) export default AnnounceDetail