forked from xiewang/react-native-emoticons
-
Notifications
You must be signed in to change notification settings - Fork 1
/
more.js
110 lines (97 loc) · 2.39 KB
/
more.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
'use strict';
import React from 'react';
import {
Text,
View,
TouchableOpacity,
Animated,
StyleSheet,
Dimensions,
TouchableWithoutFeedback,
Image,
WebView,
Platform
} from 'react-native';
var injectedJavaScript = `
delete window.postMessage
`;
class More extends React.Component {
constructor(props) {
super(props);
this.state = {
url: '',
}
}
componentDidMount() {
}
componentWillMount() {
}
_goBack() {
this.refs[WEBVIEW_REF].goBack();
const { navigator } = this.props;
if (navigator && !this.state.canGoBack) {
navigator.pop();
}
}
render() {
return (
<View style={[styles.container, {height: height - 21}, Platform.OS === 'android' ? null : {marginTop: 21}]}>
<Toolbar
title="添加商品"
navigator={this.props.navigator}
hideDrop={true}
onLeftIconClicked={this._goBack.bind(this)}
/>
<WebView
source={{uri: DEFAULT_URL}}
style={styles.web}
ref={WEBVIEW_REF}
automaticallyAdjustContentInsets={false}
scalesPageToFit={false}
javaScriptEnabled={true}
domStorageEnabled={true}
decelerationRate="normal"
startInLoadingState={true}
injectedJavaScript={injectedJavaScript}
>
</WebView>
</View>
)
}
}
const styles = StyleSheet.create({
web: {
backgroundColor: '#fff',
height: height,
width: width,
top: 0,
left: 0,
bottom: 0,
position: 'absolute',
flex: 1,
zIndex: 0
},
getItem: {
position: 'absolute',
flex: 1,
bottom: 0,
height: 40,
width: width,
backgroundColor: '#f1f1f1',
alignItems: 'center',
justifyContent: 'center'
},
getButton: {
height: 30,
backgroundColor: '#fc7d30',
width: width - 100,
alignItems: 'center',
justifyContent: 'center',
borderRadius: 15
},
getText: {
color: '#fff',
fontSize: 13
}
});
export default More;