targetProgress.js
1.75 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
/**
* Created by Cassie on 2018/05/14
*/
import React, { Component } from 'react';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
Image,
TextInput,
ScrollView,
Platform,
InteractionManager
} from 'react-native';
import PercentageCircle from 'react-native-percentage-circle';
import {width,zoomW,zoomH} from '../../utils/getSize';
const back = require('../../img/returnB.png');
const avatar = require('../../img/avatar.png');
export default class TargetProgress extends Component {
static navigationOptions = ({ navigation, screenProps }) => ({
title:'任务进度',
headerLeft:(<View style={{display:'flex',flexDirection:'row'}}>
<TouchableOpacity style={styles.topIcon} onPress={navigation.state.params?navigation.state.params.back:null}>
<Image source={back} style={{width:(16/zoomH),height:(16/zoomH)}} resizeMode="contain" />
</TouchableOpacity>
</View>),
headerRight:(<View style={{display:'flex',flexDirection:'row'}} />)
});
constructor(props){
super(props);
this.state = {};
};
componentDidMount(){
this.props.navigation.setParams({
back:()=>{
InteractionManager.runAfterInteractions(() => {this.props.navigation.goBack();})
}
});
};
render(){
return(
<View style={styles.background}>
</View>
);
}
}
const styles = StyleSheet.create({
topIcon:{
paddingLeft:(10/zoomW),
paddingRight:(10/zoomW),
height:'100%',
display:'flex',
alignItems:'center'
},
background:{
flex:1,
backgroundColor:'#fff',
display:'flex',
alignItems:'center'
}
});