Authored by zhouxl

rn升级 —review by 宏勇

@@ -17,12 +17,11 @@ let { @@ -17,12 +17,11 @@ let {
17 let NativeViewPager = requireNativeComponent('YH_ViewPager', YH_ViewPager); 17 let NativeViewPager = requireNativeComponent('YH_ViewPager', YH_ViewPager);
18 let NativeVerticalViewPager = requireNativeComponent('YH_VerticalViewPager',YH_ViewPager); 18 let NativeVerticalViewPager = requireNativeComponent('YH_VerticalViewPager',YH_ViewPager);
19 19
20 -var UIManager = require('UIManager');  
21 20
22 type Event = Object; 21 type Event = Object;
23 // var ViewPagerConsts = YH_ViewPagerView.Constants; 22 // var ViewPagerConsts = YH_ViewPagerView.Constants;
24 23
25 -import {Keyboard} from 'react-native' 24 +import {Keyboard,UIManager} from 'react-native'
26 export type ViewPagerScrollState = $Enum<{ 25 export type ViewPagerScrollState = $Enum<{
27 idle: string, 26 idle: string,
28 dragging: string, 27 dragging: string,
@@ -9,14 +9,12 @@ import { @@ -9,14 +9,12 @@ import {
9 View, 9 View,
10 Dimensions, 10 Dimensions,
11 TouchableOpacity, 11 TouchableOpacity,
12 - WebView,  
13 LayoutAnimation, 12 LayoutAnimation,
14 Platform, 13 Platform,
15 14
16 } from 'react-native'; 15 } from 'react-native';
17 16
18 -  
19 -import WKWebView from 'react-native-wkwebview-reborn' 17 +import { WebView } from 'react-native-webview';
20 18
21 const BODY_TAG_PATTERN = /\<\/ *body\>/; 19 const BODY_TAG_PATTERN = /\<\/ *body\>/;
22 20
@@ -110,34 +108,24 @@ export default class DetailText extends React.Component { @@ -110,34 +108,24 @@ export default class DetailText extends React.Component {
110 } 108 }
111 109
112 return ( 110 return (
113 - <View style={{width: width,height: this.state.realContentHeight,backgroundColor: 'white'}}>  
114 -  
115 - {  
116 - Platform.OS == 'ios' ?  
117 - <WKWebView style={{width: width-40,height: this.state.realContentHeight,backgroundColor: 'white',marginRight: 20,marginLeft: 20}}  
118 - source= {{html: codeInject(text), baseUrl: ''}}  
119 - scrollEnabled={false}  
120 - javaScriptEnabled={true}  
121 - decelerationRate="normal"  
122 - domStorageEnabled={true}  
123 - onNavigationStateChange={this.handleNavigationChange}  
124 - onShouldStartLoadWithRequest={hasLink?this.shouldStartLoadWithRequest:null}  
125 - >  
126 - </WKWebView>  
127 - :  
128 - <WebView style={{width: width-40,height: this.state.realContentHeight,backgroundColor: 'white',marginRight: 20,marginLeft: 20}}  
129 - source= {{html: codeInject(text), baseUrl: ''}}  
130 - scrollEnabled={false}  
131 - javaScriptEnabled={true}  
132 - decelerationRate="normal"  
133 - domStorageEnabled={true}  
134 - onNavigationStateChange={this.handleNavigationChange}  
135 - onShouldStartLoadWithRequest={hasLink?this.shouldStartLoadWithRequest:null}  
136 - >  
137 - </WebView>  
138 - }  
139 -  
140 - </View> 111 + <View style={{width: width, height: this.state.realContentHeight, backgroundColor: 'white'}}>
  112 + <WebView style={{
  113 + width: width - 40,
  114 + height: this.state.realContentHeight,
  115 + backgroundColor: 'white',
  116 + marginRight: 20,
  117 + marginLeft: 20
  118 + }}
  119 + source={{html: codeInject(text), baseUrl: ''}}
  120 + scrollEnabled={false}
  121 + javaScriptEnabled={true}
  122 + decelerationRate="normal"
  123 + domStorageEnabled={true}
  124 + onNavigationStateChange={this.handleNavigationChange}
  125 + onShouldStartLoadWithRequest={hasLink ? this.shouldStartLoadWithRequest : null}
  126 + >
  127 + </WebView>
  128 + </View>
141 ); 129 );
142 } 130 }
143 }; 131 };
This diff could not be displayed because it is too large.
@@ -10,27 +10,27 @@ @@ -10,27 +10,27 @@
10 "build:android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output index.android.bundle --assets-dest bundle/", 10 "build:android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output index.android.bundle --assets-dest bundle/",
11 "bundle": "sh replace-custom-components-file.sh && node bundle.js" 11 "bundle": "sh replace-custom-components-file.sh && node bundle.js"
12 }, 12 },
13 - "peerDependencies": {  
14 - "react": "^16.3.2"  
15 - },  
16 - "dependencies": {  
17 - "@react-native-community/cameraroll": "^1.2.1",  
18 - "apsl-react-native-button": "^3.1.1",  
19 - "babel": "^6.23.0",  
20 - "create-react-class": "^15.6.3",  
21 - "deprecated-react-native-listview": "^0.0.6",  
22 - "htmlparser2-without-node-native": "^3.9.2",  
23 - "immutable": "^3.8.2",  
24 - "key-mirror": "^1.0.1",  
25 - "lodash": "^4.17.10",  
26 - "md5": "^2.2.1",  
27 - "moment": "^2.22.1",  
28 - "object-assign": "^4.1.1",  
29 - "prop-types": "^15.6.1",  
30 - "query-string": "^6.1.0",  
31 - "react": "^16.9.0",  
32 - "react-immutable-proptypes": "^2.1.0",  
33 - "react-native": "^0.61.2", 13 + "peerDependencies": {
  14 + "react": "^16.3.2"
  15 + },
  16 + "dependencies": {
  17 + "@react-native-community/cameraroll": "^1.2.1",
  18 + "apsl-react-native-button": "^3.1.1",
  19 + "babel": "^6.23.0",
  20 + "create-react-class": "^15.6.3",
  21 + "deprecated-react-native-listview": "^0.0.6",
  22 + "htmlparser2-without-node-native": "^3.9.2",
  23 + "immutable": "^3.8.2",
  24 + "key-mirror": "^1.0.1",
  25 + "lodash": "^4.17.10",
  26 + "md5": "^2.2.1",
  27 + "moment": "^2.22.1",
  28 + "object-assign": "^4.1.1",
  29 + "prop-types": "^15.6.1",
  30 + "query-string": "^6.1.0",
  31 + "react": "^16.9.0",
  32 + "react-immutable-proptypes": "^2.1.0",
  33 + "react-native": "^0.61.2",
34 "react-native-device-info": "^0.21.5", 34 "react-native-device-info": "^0.21.5",
35 "react-native-fabric": "^0.5.1", 35 "react-native-fabric": "^0.5.1",
36 "react-native-fetch-blob": "^0.10.8", 36 "react-native-fetch-blob": "^0.10.8",
@@ -43,9 +43,10 @@ @@ -43,9 +43,10 @@
43 "react-native-simple-store": "^1.3.0", 43 "react-native-simple-store": "^1.3.0",
44 "react-native-smart-toast": "^1.1.1", 44 "react-native-smart-toast": "^1.1.1",
45 "react-native-swipeable": "^0.6.0", 45 "react-native-swipeable": "^0.6.0",
46 - "react-native-swiper": "^1.5.13", 46 + "react-native-swiper": "^1.6.0-rc.3",
47 "react-native-switch-pro": "^0.4.11", 47 "react-native-switch-pro": "^0.4.11",
48 "react-native-view-shot": "^2.4.0", 48 "react-native-view-shot": "^2.4.0",
  49 + "react-native-webview": "^7.5.2",
49 "react-native-wkwebview-reborn": "1.22.0", 50 "react-native-wkwebview-reborn": "1.22.0",
50 "react-redux": "^5.0.7", 51 "react-redux": "^5.0.7",
51 "react-static-container": "^1.0.2", 52 "react-static-container": "^1.0.2",
@@ -3105,6 +3105,11 @@ escape-html@^1.0.3, escape-html@~1.0.3: @@ -3105,6 +3105,11 @@ escape-html@^1.0.3, escape-html@~1.0.3:
3105 resolved "http://npm.yohops.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" 3105 resolved "http://npm.yohops.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
3106 integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= 3106 integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
3107 3107
  3108 +escape-string-regexp@2.0.0:
  3109 + version "2.0.0"
  3110 + resolved "http://127.0.0.1:8081/repository/npm-all/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
  3111 + integrity sha1-owME6Z2qMuI7L9IPUbq9B8/8o0Q=
  3112 +
3108 escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: 3113 escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
3109 version "1.0.5" 3114 version "1.0.5"
3110 resolved "http://npm.yohops.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 3115 resolved "http://npm.yohops.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
@@ -4207,7 +4212,7 @@ inquirer@^7.0.0: @@ -4207,7 +4212,7 @@ inquirer@^7.0.0:
4207 strip-ansi "^5.1.0" 4212 strip-ansi "^5.1.0"
4208 through "^2.3.6" 4213 through "^2.3.6"
4209 4214
4210 -invariant@*, invariant@^2.2.2, invariant@^2.2.4: 4215 +invariant@*, invariant@2.2.4, invariant@^2.2.2, invariant@^2.2.4:
4211 version "2.2.4" 4216 version "2.2.4"
4212 resolved "http://npm.yohops.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" 4217 resolved "http://npm.yohops.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
4213 integrity sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY= 4218 integrity sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=
@@ -6662,10 +6667,10 @@ react-native-swipeable@^0.6.0: @@ -6662,10 +6667,10 @@ react-native-swipeable@^0.6.0:
6662 dependencies: 6667 dependencies:
6663 prop-types "^15.5.10" 6668 prop-types "^15.5.10"
6664 6669
6665 -react-native-swiper@^1.5.13:  
6666 - version "1.5.14"  
6667 - resolved "http://npm.yohops.com/react-native-swiper/-/react-native-swiper-1.5.14.tgz#1c6f949ca377186300f972bb0f30d24062c899aa"  
6668 - integrity sha1-HG+UnKN3GGMA+XK7DzDSQGLImao= 6670 +react-native-swiper@^1.6.0-rc.3:
  6671 + version "1.6.0-rc.3"
  6672 + resolved "http://127.0.0.1:8081/repository/npm-all/react-native-swiper/-/react-native-swiper-1.6.0-rc.3.tgz#ece82906d908c6a78a0b75fa41982ffc2cd2fb20"
  6673 + integrity sha1-7OgpBtkIxqeKC3X6QZgv/CzS+yA=
6669 dependencies: 6674 dependencies:
6670 prop-types "^15.5.10" 6675 prop-types "^15.5.10"
6671 6676
@@ -6681,6 +6686,14 @@ react-native-view-shot@^2.4.0: @@ -6681,6 +6686,14 @@ react-native-view-shot@^2.4.0:
6681 resolved "http://npm.yohops.com/react-native-view-shot/-/react-native-view-shot-2.6.0.tgz#3b23675826f67658366352c4b97b59a6aded2f43" 6686 resolved "http://npm.yohops.com/react-native-view-shot/-/react-native-view-shot-2.6.0.tgz#3b23675826f67658366352c4b97b59a6aded2f43"
6682 integrity sha1-OyNnWCb2dlg2Y1LEuXtZpq3tL0M= 6687 integrity sha1-OyNnWCb2dlg2Y1LEuXtZpq3tL0M=
6683 6688
  6689 +react-native-webview@^7.5.2:
  6690 + version "7.5.2"
  6691 + resolved "http://127.0.0.1:8081/repository/npm-all/react-native-webview/-/react-native-webview-7.5.2.tgz#9da3006e03636faaa9d05f3abff46cd40bfb80f9"
  6692 + integrity sha1-naMAbgNjb6qp0F86v/Rs1Av7gPk=
  6693 + dependencies:
  6694 + escape-string-regexp "2.0.0"
  6695 + invariant "2.2.4"
  6696 +
6684 react-native-wkwebview-reborn@1.22.0: 6697 react-native-wkwebview-reborn@1.22.0:
6685 version "1.22.0" 6698 version "1.22.0"
6686 resolved "http://npm.yohops.com/react-native-wkwebview-reborn/-/react-native-wkwebview-reborn-1.22.0.tgz#f870d0f409d30783265f4a2a3ff91d23991b3128" 6699 resolved "http://npm.yohops.com/react-native-wkwebview-reborn/-/react-native-wkwebview-reborn-1.22.0.tgz#f870d0f409d30783265f4a2a3ff91d23991b3128"