xnLoading.js
2.36 KB
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
/**
* Created by DEV005 on 2017/10/27.
*/
import React, { Component } from 'react';
import { BackHandler,AppState,StyleSheet,View,Text
, NativeModules,AsyncStorage,NavigationActions,
ActivityIndicator,TouchableOpacity,Image,Touch,Platform,Dimensions
} from 'react-native';
import {width,height} from "../utils/getSize";
import {xnToast,getHeaderHeight,getHeaderPadding,getFooterBottom,xnBorderWidth} from "../utils/utils";
export default class xnLoading extends Component {
constructor(props){
super(props);
this.state = {
};
}
componentDidMount() {
};
_close=()=>{
NativeModules.system.navTo("BACK")
}
render() {
return (
<View style={styles.xnLoading}>
<View style={styles.xnLoadingHd} >
<TouchableOpacity style={styles.xnLoadingHdBack} onPress={()=>{this._close()}}>
<Image style={styles.xnLoadingHdIcon} source={require('../img/loadBack.png')} resizeMode="contain"/>
</TouchableOpacity>
</View>
<View style={styles.xnLoadingBd} >
<ActivityIndicator style={styles.xnLoadingActivity} size='small' color='#d9d9d9' animating={true}/>
<Text style={styles.xnLoadingBdText}>加载中...</Text>
</View>
<TouchableOpacity style={styles.xnLoadingFt} onPress={()=>{this._close()}}><Text style={styles.xnLoadingFtText}>关闭</Text></TouchableOpacity>
</View>
);
};
};
const styles = StyleSheet.create({
xnLoading:{
flex: 1,
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'space-between',
},
xnLoadingHd:{
width:width,
paddingTop:getHeaderPadding(),
height:getHeaderHeight(),
justifyContent: 'center',
},
xnLoadingHdBack:{
paddingLeft:15,
paddingRight:10,
paddingTop:10,
paddingBottom:10,
width:41,
height:36,
},
xnLoadingHdIcon:{
width:16,
height:16
},
xnLoadingBd:{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
},
xnLoadingActivity:{
marginRight:15,
},
xnLoadingBdText:{
fontSize:14,
color:"#000"
},
xnLoadingFt:{
height:44,
width:width,
alignItems: 'center',
justifyContent: 'center',
backgroundColor:"#f9f9f9",
borderTopWidth:xnBorderWidth(),
borderTopColor:"#d9d9d9",
},
xnLoadingFtText:{
fontSize:16,
color:"#000"
}
});